Posted: Tue Jan 16, 2007 7:50 pm
The number of things I don't know is enormous and seems to grow daily!Maugrim_The_Reaper wrote:I guess there's some terminology you've missed, arborint, in your OOP reading...![]()
I never stop...Maugrim_The_Reaper wrote:When you finish kicking youself...
Never heard of that either ... which is interesting considering that I have read it:Maugrim_The_Reaper wrote:You do know this of course... Also called the "concept that varies" rule which is likely the more common use term...
Allan Shalloway from Design Patterns: "Consider what should be variable in your design. Focus on encapsulating the concept that varies. This mandate was a bit confusing to me at first. To me, encapsulation meant "data-hiding". But to the Gang of Four, it means something else: Encapsulating the concept that varies is encapsulation of type."
It ends up there is a little more to the idea than your quote implies...
Now I have read that -- it's Tom DeMarco. I would say that that idea is fairly old and I think has been superseded by GRASP -- especially for web development. This is a huge subject and these little one-liners don't do it much justice. There is a general reason for cohesion, but there are also may reasons why you would knowingly lower cohesion. It might be an interesting thread as I have pestered ole enought here...ole wrote:OO Design Principles wrote:Single Responsibility Principle
A class should have only one reason to change