> > Instead of focusing on the implementation of the getter itself, > consider whether it really needs to be part of the class API. Let's > suppose that we have a person class and in our application we're very > interested in the person's age. So we add getAge() because it is > required by the business model. Let's suppose that we initially have > people entering their actual age, so getAge() simply returns that. We > quickly realize that we really need people's birth date instead so we > update person to have a birth date and remove age - and > modify getAge() > to calculate the age based on the birth date. > > That's your scenario but focus on the API and the methods, not on the > attributes. > > When you're building a model, e.g., in UML, you identify the nouns > (classes) and verbs (methods). The actual attributes of a class are > 'merely' implementation artifacts.
So, what you are saying is that there is a business need for age and it _just_ so happens to coincide with a data member? -rc ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
