• 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

OO Swiss Army Knife? (from the desert island dept.)

 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm wondering if you OO gurus would comment on what OO principles you think are most important for the aspiring OO developer? If you could only bring 5 (or so) principles with you to a desert island, which ones would you pick? Which are most foundational, or most commonly used?

True confession, right up front. I got the following list from objectmentor.com

ocp - open closed principle
lsp - liskov substitution principle
dip - dependency inversion principle
isp - interface segregation principle
rep - reuse/release equivalency principle
ccp - common closure principle
crp - common reuse principle

principles of package coupling
adp - acyclic dependencies principle
sdp - stable dependencies principle
sap - stable abstraction principle

I definitely don't think that this is the list I'd create, and I'm not convinced that this list is the superset of the list I'd create. (In other words some key principles might be missing from this list.)

Talk amongst yourselves

Bert
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Missing are at least:

srp - single responsibility principle
scp - single choice principle
lod - law of demeter

I wouldn't know which ones to pick, though - I definitely use them all.

Why do you ask?
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We cover some OO concepts in Head First Java, and we cover some additional concepts in Head First Design Patterns. Dave Wood has completed maybe 80% of Head First Objects. Our hope is that the three books will work together well, and that they will provide a good foundation in both Java and in Object Oriented software development.

I'm doing a review of the three books to see if we have good coverage of the basics. I ask this question as a way to get some unbiased opinions about what would constitute a good set of foundational concepts and principles, to see how such an unbiased set of opinions matches up with what we've already got, and what we plan to provide with the HF Objects book. (In other words, it's not too late to add a chapter if we're convinced that we've missed something important ).

Thanks!

Bert
 
(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 wasn't familiar with Single Choice and Googled for it. The top hit ... Tablizer! I recognized it from the content before I checked the URL.
 
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
I see - that helps!

I'd say that the ocp is the most basic (and most abstract) principle - it really is what basically motivates most of the others, but doesn't tell you much about how to achieve it.

lsp, srp and scp are the next most important to a beginner, in my opinion, as they give very straightforward help in how to achieve the ocp.

dip and isp are more complicated to understand and apply, but also give a very deep inside into how polymorphism can be used to manage code dependencies. Very important, but advanced topics, in my opinion.

The package-related principles are less important to grok OOP, in my opinion. They apply more at the binary packaging (jar-file) level than the java package level. If at all, I'd concentrate on adp, sdp and sap and drop rep, ccp and crp.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic