Can anyone show me the some example on implementing EMPTY class ? Is it possible to add an "EMPTY CLASS" to a form and act as a public variable ?
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.