tell me I'm wrong (or right)
Apr. 4th, 2011 05:09 pmI'm pretty much tired of using so-called "DAO objects", automatically hibernate-generated classes that are dumb and simple; they are being used everywhere throughout the code; I was always willing to fill them with functionality, but, thank god, there was no chance.
Now I think this. Thanks to
mikkim08 ideas for Scala. They should be all wrapped in decorators; and decorators should be returned from DAOs or factories. Performance-wise, it is just one level of indirection, and one more reference per instance. Conceptually, it is an implicit mapping.
E.g. I get "CountryData" from db; it is dumb and know nothing about life, just data. Wrap it in a subclass, and kaboom, an intelligent guy who can tell you this and that... and yes, immutable, since all "setters" are blocked by police.
So there.
Now I think this. Thanks to
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
E.g. I get "CountryData" from db; it is dumb and know nothing about life, just data. Wrap it in a subclass, and kaboom, an intelligent guy who can tell you this and that... and yes, immutable, since all "setters" are blocked by police.
So there.