• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What are the principles of OOA/D?

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone explain?
[ August 24, 2005: Message edited by: Glen Cai ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are inheritance, encapsulation, polymorphism the OO principles?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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 ]
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic