> 2010/12/18 Benoît Minisini <gam...@users.sourceforge.net>: > > I think that already exists: it's named "Property". :-) > > > > -- > > Benoît Minisini > > Hi Benoît. I know that property exists, but: > > > 1) In some situations (rare I admit, but real) could be necessary > write a setter and unnecessary write a getter, but properties are > both: write and read or only read, there's no option to automatically > write only the code for property write
For me, a write-only property is a non-sense. Just use a normal method then. > 2) Properties, forces to have more code Just one line to declare the property. > 3) Properties, forces to use the dot notation or to write getters and > setter by hand No, both. And this is better. It allows to underline that normally a property is a light O(1) process (just reading something somewhere, or writing and updating something somewhere), whereas a method underlines a more complex and heavier algorithm. > 4) Write and Read methods are generated while code is being write. I > would appreciate can write sketch code for a class without Write/Read > or getters/setters methods, and when I finished the class design can > generate that code automatically by one step. When you enter the property declaration, the getter and the eventual setter are written automatically. But they do nothing, so what is the problem? Setter and getters were invented only for languages that do not have properties. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user