4 ms·
Depends on how you use it, of course. Libraries make wonderful showcases for OOP strengths - I always like to give Java Collections as an example. But if you ac
by radu_floricica 11y ago
Depends on how you use it, of course. Libraries make wonderful showcases for OOP strengths - I always like to give Java Collections as an example. But if you actually build your application code as OOP... well, I might privately think you deserve everything that happens to you because of that.
I think education carries most of the guilt for this. The typical examples given in OOS classes are stuff like Car is an ancestor of Truck and SportsCar. Which led to Beans and Entreprise Java. You never want this kind of shit with your data. Much better to use plain old maps to carry content the way God intended, and to put your effort in creating flexible and reusable methods.
- JupiterMoon 11y agoThis example looks bad to me -- shouldn't it be that car, truck and sports car have (at most) a common vehicle superclass?
- sz4kerto 11y ago> But if you actually build your application code as OOP > Beans and Entreprise Java I don't know. Netflix is built on Java, using OOP. It works well for them. Windows is built on OOP, quite a big application and works. J2EE has its problems, but it also gives you a lot of functionality. Reusing methods is nice, but developers on projects with very complex business rules (does not equal simple, but large scale projects!) don't worry that much about flexible methods as they're experienced enough. Distributed transactions, session replication, etc. are slightly more important. J2EE gives you all that by default. (And I really don't like EJBs and this kind of stuff, but don't mix up two very different levels of problems.)
- radu_floricica 11y ago> J2EE has its problems, but it also gives you a lot of functionality I did have that in the back of my head when I wrote the comment. And speaking of, I'm also aware that OOP was very popular, and I don't feel completely comfortable when I criticize successful stuff - it must have worked for a reason. But still, that's as far as my brain can take me by itself: OOP should be used sparingly and EJB should not exist. (For the record I code mostly in Java, though as lisp-like as I can)
- flipp3r 11y agoBut aren't beans just maps with additional constraints on the data..?