Mar 4th, 2012, 12:18 AM
Ideas for reducing number of properties in my domain objects?
I have a domain object called User that is becoming bloated due to all of the properties and getters/setters. I want to group some of the related properties together into a single object somehow. I have never done this before so I was wondering if anyone had any ideas on how this could be best accomplished.
For example i have:
private Set<Group> ownedGroups = new HashSet<Group>();
private Set<GroupMember> joinedGroups = new HashSet<GroupMember>();
private Set<GroupInvite> groupInvites = new HashSet<GroupInvite>();
It would be nice to somehow group them together. I believe I still want those to be in separate tables still. Maybe I could create an object called GroupData that would have all three of those sets as properties?
I'm using hibernate3 and spring2.5.