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
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
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
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?
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
Joined: Oct 14, 2002
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 ).
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.
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
Joined: Jul 11, 2001
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.