Heenan, Lambert
Lambert.Heenan at AIG.com
Tue Jun 13 09:21:03 CDT 2006
Thanks for the tip about Ruby. Yet another language to play with! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, June 13, 2006 10:05 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ... OK, lets see... Lambert is correct in that using public variables to create class properties is 'bad practice', or at least non-standard. Drew is correct in that because it can be done in the language, it is 'right', or at least allowable. But the interesting thing to me is no one talks about what is missing in VB objects: * No true class-level variables. All member variables of a class are instance variables. Class variables would eliminate most of the need for globals in VB. * No true constructor. You'd like to create objects like this, but you can't: Set Obj = New clsPerson("Ken", "123 Any St", 789) * No true singleton object. You can simulate it using modules with properties, or public object variables, but neither approach is a complete solution. * No inheritance model, whether it be single, multiple, or mixin. Finally, if you want compact and correct property declarations, look at this Ruby example: Class MyClass attr_accessor :name, :address, :emplID End This creates the instance variables, getters and setters for the three named properties, all in one line. I bring Ruby up because, in arguements over what are essentially limitations of a language, it is valid to suggest alternatives. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com