Delphi Clinic | C++Builder Gate | Training & Consultancy | Delphi Notes Weblog | Dr.Bob's Webshop |
|
Creating properties easy
A lot of times we simple create a record class for holding information.
The structure of the class is straightforward: we define private data members and define public get and set methods.
We can of course do this by hand, but after a few classes, we start to wonder if this cannot be done more easy?
We find the answer in the BeansExpress Wizard. We can use functionality from this Wizard to quickly create properties. Let's see how this works with a simple example:
public class Bookmark { private java.net.URL url; private String name; public java.net.URL getUrl() { return url; } public void setUrl(java.net.URL newUrl) { url = newUrl; } public void setName(String newName) { name = newName; } public String getName() { return name; } }