The empty class is nice way to consolitate all those public variables into a class/property design. It contains no properties or methods so it is very lightweight - compared to, let's say, a container class. You can do the same with a container, but it has overhead we don't need.
The empty class is nice easy to implement. Here is how you do it in a form.
1. add a new property to the form, I call mine data.
2. add the following code in the INIT event of the form.
THISFORM.data = CREATEOBJECT('empty')
addproperty(THISFORM.data,'customer')
addproperty(THISFORM.data,'id')
THISFORM.data.customer = "Sammy Sample"
THISFORM.data.customer = "123"
MESSAGEBOX(THISFORM.data.customer)
MESSAGEBOX(THISFORM.data.id)
You can also use this in your startup program. Therefore, all those public variables can be changed to properties of one public variable.
In my opinion though - the empty class needs the ability to programmatically add methods to it. Until that time comes - We stil need a container of some sort to hold the methods.
Jim Osieczonek
Delta Business Group, LLC