File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic