http://www.perlmonks.org?node_id=518673


in reply to OO design and persistence

from a DB perspective, if a chuck of info is someting that you would logically normalize ... should (it) be its own object?

My favorite node on 'big picture' questions in OOP: The world is not object oriented.
(see also OO concepts and relational databases mentioned elsewhere in this thread)

Often the 'academic' approach to OOP and Data Architecture differs dramatically from the 'nuts and bolts' approach. This contrast in approaches is made more thorny by the fact that "Object Orientation" means different things to different people; even if they come from the same "school of thought"! From an academic perspective, this is a good thing, because it means more opportunities to publish articles, debate, and apply for grants.

From a nuts and bolts perspective, most end-users and I.T. clients do not care how sophisticated your object heirarchy is, or how clever you were in implementing it. What matters to them is whether they get what they expect: a performant application that does not make them have to think too hard.

With all the fire and noise generated behind the alluring mystique of OOP, very few people acknowledge that OO programming and Functional programming really have a lot in common, and consequently do not require such dramatic shifts in perspective when it comes to uniting the codebase with the persistence layer.

Sometimes, the only tangible difference (to the programmer) is just a difference in syntax. Consider:

### style1 $str = 'lrep'; $str = uc($str); $str = reverse($str); print $str; ### style2 $str = 'lrep'; $str = reverse(uc($str)); print $str; ### style3 $str = 'lrep'; $str.toUpperCase().reverse().toConsole();
This is of course a simplification, but the point is do not let yourself get too mystified by the terminology and buzzwords; if your programming methodology is driving your choices for persistance ... you *might* have a candidate for over-engineered design.

=oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV