(responding to Sumesh)

> I have four common attributes in every class. Instead of
> creating them every time I create a class, is there an easy
> way I can create them once and plug them into every
> class I create thereafter.

There are several ways this can be done, by encapsulating in
a class and inheriting the class, by encapsulating in a class
and having an instance of the class as an attribute, by cut and
paste...  but which is appropriate?

Go back to Analysis.  Ask yourself why so many classes
need these 4 attributes.  Do they group together to
form some common concept?  Or maybe not Analysis -
do they group together to form some Design concept?

In other words, what IS it about all these classes that they
should all need the same set of attributes?  Is it blind
coincidence, or are they all the same in some particular way?

Get the analysis (or design) question answered correctly,
and the modelling question should answer itself.

Paul Oldfield

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
www.aptprocess.com

any opinions expressed herein are not necessarily those of
Mentors of Cally or the Appropriate Process Movement
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe rose_forum
*************************************************************************

Reply via email to