-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: need advice on enum and attribute structure.
PostPosted: Tue Jul 27, 2004 8:21 am 
Beginner
Beginner

Joined: Wed Mar 10, 2004 9:51 am
Posts: 42
Location: France
Hello,
I am really uncertain of the best way to design and I would
appreciate the advice of anyone on this list.

I work alone so I don't really have a colleague to ask this
question to.

In the application that I am working on there is an entitity for a house.

The house has a lot ( 25 + ) attributes.

Now a lot of these attributes (15) will not be applicable to every house.
ie pool, tennis court, charges etc etc

Here is an example.

A house may have a swimming pool, no swimming pool or the option to
build a swimming pool.

If it does have a swimming pool or the option to build a swimming pool
then there will have to be an explanation, ie "there is a small 5m pool".

Now I am using the PersistentCharacterEnum
( http://www.hibernate.org/203.html ) pattern to hold the enum.

It works great by the way !

My dilema is where should I put the description.

Should I create a house (0 .. 1) swimmingPool mapping + have
an attribute for whethere there is , isn't or there is an option to
build a swimming pool.

I really can't make up mind about the best approach and I want
to make sure I make the right decision.

Any advice appreciated .

Regards

Bryan

_________________
Pesimist: The glass is half empty
Optimist: The glass is half full
Engineer:The glass should be half that size


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 9:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I'd rather create an 1-n association from House to "Option" or something like that where Option is like

Code:
class Option {
     OptionTypeEnum optionType;
     String description;
}


Sounds like a good case for a component-set mapping.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 9:36 am 
Beginner
Beginner

Joined: Wed Mar 10, 2004 9:51 am
Posts: 42
Location: France
Thank you Michael, that is what I thought as well but just wanted to ask
someones opinion before I went ahead with it.

Best Regards

Bryan

_________________
Pesimist: The glass is half empty
Optimist: The glass is half full
Engineer:The glass should be half that size


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.