Hello all,

I'm a bit of a newb to Fluent NHibernate (and NHibernate in general)
so pardon me if this has already been answered.

I am building a survey edit and imputation system.  I have a concept
in my domain of a Class.  This is the set of possible responses for a
variable.  However, Responses come in three flavours: Coded, Numeric
and String.

A Coded Response is called a Code and consists of a Label (like
PERSON1) and a number (11).  The number is used when the data is
stored but the Label is used in things like decision logic tables.
Many  coded responses can make up a class

A Numeric Response is called an interval and is basically a min and a
max value.  Many intervals can make up a class.

A String Response is called a pattern and is a regular expression.
Many patterns can make up a class.

A Class can be any one of the above things but can only ever be one of
them.

My question is ... how would you build the domain to handle this and
how would NHibernate map it?

My initial stab is this:

    public class Class : IEntity
    {
        public string Name { get; set; }
        public IList<Code> CodedResponses { get; private set; }
        public IList<Interval> NumericResponses { get; private set; }
        public IList<Pattern> StringResponses { get; private set; }

        public Class()
        {
            CodedResponses = new List<Code>();
            NumericResponses = new List<Interval>();
            StringResponses = new List<Pattern>();
        }
    }

... and then map the different lists to the different table types.  I
would build business logic in to make sure that the user cannot add an
interval into

Is this a good solution or is there a better way?

Thanks in advance

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to