File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes What are the principles of OOA/D? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "What are the principles of OOA/D?" Watch "What are the principles of OOA/D?" New topic
Author

What are the principles of OOA/D?

Glen Cai
Ranch Hand

Joined: Aug 24, 2002
Posts: 121
Could anyone explain?
[ August 24, 2005: Message edited by: Glen Cai ]

"I, a universe of atoms, an atom in the universe." - Richard Feynman
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
There are many! Robert Martin has put a nice collection of 11 together. THS BLOG references a set of articles on the 11, and the "PPP" book he mentions is a must read if you want to explore this stuff thoroughly.

I collected a few articles and such HERE that you're welcome to read and comment on. Look for light-hearted ideas like "Don't Confuse Your Dog".

We love this stuff. Try a few of these articles on for size and let us know what you think.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Elizabeth King
Ranch Hand

Joined: Jul 11, 2002
Posts: 191
Are inheritance, encapsulation, polymorphism the OO principles?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Elizabeth King:
Are inheritance, encapsulation, polymorphism the OO principles?

Not really. Inheritance, encapsulation and polymorphism are more like properties or features of object-oriented design more than principles.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sever oon
Ranch Hand

Joined: Feb 08, 2004
Posts: 268
Here's a list of articles on various design principles. Start with the article called Principles and Patterns and work your way through from there.

I cannot express this enough--these are the best articles written by authorities on the general principles of OO design and analysis that I've ever seen.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I recommend Uncle Bob's work frequently, but want to throw out one warning: Some of the C++ articles solve problems Java doesn't have. If you think you may have stumbled into one of those, throw out a lifeline here and we can figure it out together. Cheers!
Futer
Greenhorn

Joined: Aug 28, 2005
Posts: 2
Here a some OO principles you can read in the fabulous O'Reilly book "Head First in Design Patterns" :

1) Encapsulate what varies
2) Favor composition over inheritance
3) program to interfaces not implementations
4) Strive for loosely coupled designs between objets that interact
5) Classes should be open for extension but closed for modification (Bertrand Meyer)
6) Depend on abstractions Do not depend on concrete classes
7) Only talk to your friends
8) Don't call us, we' call you (use callback functions)
9) A class should have only one reason to change
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
"Futtersack",

welcome at JavaRanch!

We don't have many rules here, but one thing we like is to speak to real humans (in contrast to feed bags ). Therefore we have a naming policy that requires every member to use a real sounding name as his display name. Please adjust your display name accordingly. Thanks!
[ August 28, 2005: Message edited by: Ilja Preuss ]

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by FUTTERSACK MICHEL:
1) Encapsulate what varies
9) A class should have only one reason to change



The Single Responsibility Principle.


3) program to interfaces not implementations
4) Strive for loosely coupled designs between objets that interact
6) Depend on abstractions Do not depend on concrete classes


Dependency Inversion Principle


5) Classes should be open for extension but closed for modification (Bertrand Meyer)


Open Closed Principle, obviously.


7) Only talk to your friends


Law of Demeter


2) Favor composition over inheritance


I don't think this is a good principle. It's a good heuristic for beginners who tend to overuse inheritance. Experienced developers don't favor composition over inheritance, they try to find a good balance between them.

What seems to be missing are

Single Choice Principle, and
Liskov's Substitution Principle
Futer
Greenhorn

Joined: Aug 28, 2005
Posts: 2
You can find an EXCELLENT article on OO Design here :
http://www.design-up.com/data/principesoo.pdf

The most known principles are explained very clearly.
Unfortunatly, the article is in french
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: What are the principles of OOA/D?