aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes java beans and oo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "java beans and oo" Watch "java beans and oo" New topic
Author

java beans and oo

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Are Java beans non-OO because they have no behaviour.


Groovy
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

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.
Vagner Freitas
Ranch Hand

Joined: Aug 02, 2004
Posts: 85
Hi,

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

Vagner


SCJA, SCJP, SCBCD & SCEA (Part I)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java beans and oo