• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java beans and oo

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are Java beans non-OO because they have no behaviour.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, because of a simple, but common misunderstanding: Java Beans can have behaviour.

Ok, so is a Java Bean without behaviour non-OO?

Well, I couldn't tell. OOD/P isn't about the structure of isolated classes, it is about managing the dependencies between the classes inside a system.

Well designed systems may still contain classes with only data and no behaviour - DTOs are an example. You should be wary if you have many of those, though, as they are an indication of an Anemic Domain Model.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

No, because of a simple, but common misunderstanding: Java Beans can have behaviour.



Right but I hardly see it. Entity beans are another example which is nothing but a class get/set and lifecycle methods.

Anemic Domain Model.



What is that ? Thanks Ilja for your reply.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Anemic Domain Model is an anti-pattern published for Martin Fowler.

Vagner
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic