[ajug-members] design

Wilson, Jeff jw9615 at att.com
Thu Feb 19 10:32:04 EST 2009


In general, the accepted way most people look at objects are that they
are the "nouns". Methods that work on the objects are the "verbs".
Systems are built by having a network of objects that invoke methods on
each other.

Some nouns will be concepts in your business domain or problem space.
Other nouns are computer science concepts like sessions, transactions,
threads, etc.

That is an incredibly simplified view of the world of OO. It misses a
lot of good design practices, conventions, and so many other concepts
that I can't list here, but I will list some other crucial points:

Objects represent a concept and have methods that conceptually map onto
those concepts. 

Objects contain data that are needed to support that concept. 

The methods are considered to be the behavior of the object. 

The data in an object should not be exposed to the rest of the
application unless that exposure is a part of the concept. (Arguably,
most classes should not contain getter or setter methods for their
fields, and all fields should be private.)

I assume you are comfortable with procedural code, in which you've got a
bunch of functions and pass around data structures between them. Robert
Martin, in his book _Clean Code_, makes this statement about the
differences between procedural and OO code:

"Procedural code makes it easy to add new functions without changing the
existing data structures. OO code, on the other hand, makes it possible
to add new classes without changing any existing function.

"Procedural code makes it hard to add new data structures because all
the functions must change. OO code makes it hard to add new functions
because all the classes must change."

+jeff (MJW)
---

"The first 90% of the code accounts for the first 90% of the development
time. The remaining 10% of the code accounts for the other 90% of the
development time."
      -- Ninety-Ninety Rule

---------------------------------------------
M. Jeff Wilson, Lead Member Technical Staff
AT&T Services, Inc.
Operations & Service Dev
jw9615 at att.com 
+1 404.499.7235

-----Original Message-----
From: 521 [mailto:521 at ofig.org] 
Sent: Monday, February 16, 2009 10:04 AM
To: ajug-members at ajug.org
Subject: [ajug-members] design

by design, in java- or oop in general- is it best to have classes made 
as follows...

  -certain classes are designed to be the motors or engines of an 
application
  -certain classes are designed to the the nouns/subjects of the 
application
  -other classes, maybe, some other stuff, etc?

barclay

_______________________________________________
ajug-members mailing list
ajug-members at ajug.org
http://www.ajug.org/mailman/listinfo/ajug-members

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA621





More information about the ajug-members mailing list