Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: ian pano
  Where is ian pano?
 Metro Manila
 Philippines
 ian pano
 Tags
Subject: creating get and set methods for classes
Thread ID: 155190 Message ID: 155190 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Thursday, December 27, 2007 7:13:02 AM         
   


dear experts,

DEFINE CLASS person as Custom
	PROTECTED fname
	
	PROCEDURE setfName()
	LPARAMETERS tcStr
		This.Fname = tcStr
	ENDPROC
	
	FUNCTION getfName()
		RETURN This.fname 
	ENDFUNC
ENDDEFINE


if i am not mistaken, this is a good practice in OOP, providing an interface for the class users to access or assign a property instead of allowing them to directly manipulate a class' property.

however, is it worth the effort if the class has more than 30 or so properties?


tia,

christian pano
" The bad is entirely my own fault "- Andy Kramek

ENTIRE THREAD

creating get and set methods for classes Posted by Christian Pano @ 12/27/2007 7:13:02 AM
RE: creating get and set methods for classes Posted by Vladimir Zhuravlev @ 12/27/2007 7:55:21 AM
RE: creating get and set methods for classes Posted by Boudewijn Lutgerink @ 12/27/2007 9:02:11 AM
RE: creating get and set methods for classes Posted by Cetin Basoz @ 12/27/2007 3:09:00 PM
RE: creating get and set methods for classes Posted by Ken Murphy @ 12/27/2007 4:03:24 PM