Subject RE: [firebird-support] Re: must create dommain?
Author Leyne, Sean

> >Is there any best pratice to use? If I create one dommain for each
> >different type is a good solution? For example, one domain for
> >char(2), one dommain for char(1), other to char(10). This is normal?
> No.

I would say yes.

> Generally, you would create a domain to comprise a number of
> attributes, and then re-use that domain for all columns that
> need to have those attributes.

Very true!

> There is no point in creating "one-use" domains that have no
> attributes except data type. Firebird already does that.

But it was never said that the domain would be "one-use"!

> Here are a couple of examples where domains are useful. All
> of my dynamic tables have generated primary keys. Thus, in
> a Dialect 3 database, they are always non-null BigInt. So I
> have this domain:

Great examples -- although my boolean is a smallint (0 or 1) ;-)

> I don't think it is a good idea at all to define domains
> purely on the basis of type and size and then use them to
> define columns that are controlled by different sets of
> business rules.

If too narrowly defined, true!

> One member of the domain could change its requirements
> independently of other members' usages of it. What
> happens then?

Simple! Change the domain for the exception item, leave the other
'users' of the domain unchanged! (Your reply didn't really consider
this option)

> Are you going to change the domain to fit that one
> member, and break the domain for all of the other usages?

Of course not!