Re: desgin tables into objects or vice versa?
- From: "Nick Hounsome" <nh002@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 08:31:18 GMT
"Elhanan" <emaayan@xxxxxxxxxxx> wrote in message
news:1138349688.217482.21710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> hi..
>
> i'm a database kind of guy, when ever i apprached a new project i
> always looked at it from tables point of view, how can normlize
> correcly and them moved to the objects and desgined them accodging to
> the tables..
>
> i see that usually ppl go the other way, design objects and then desgin
> the tables..
>
> i was looking into my tables and usually i see i have column
> type_of_somthing in it. like request_type in requests table or
> order_type in orders tables, etc...
> i was wondering, whenever i see this type of columns would it be right
> to design a class tree according to it? for example abstract order
> class and each subclass would correspond to an order type.
If different types must be processed differently then inheritance and
virtual methods are probably good.
If the processing is the same apart from some extra fields the probably best
not to bother.
If the fields differ other than by addition then processing must be
different and inheritance and polymorphism would be good.
Sometimes it can be better to handle these issues by sticking with a request
type but rather than using switch or if...then..else you use a dictionary to
look how to process the data. The advantage of this method is that the
dictionary can be populated using resource files and reflection.
.
- References:
- desgin tables into objects or vice versa?
- From: Elhanan
- desgin tables into objects or vice versa?
- Prev by Date: desgin tables into objects or vice versa?
- Next by Date: Re: com interop v2003
- Previous by thread: desgin tables into objects or vice versa?
- Next by thread: Re: desgin tables into objects or vice versa?
- Index(es):
Relevant Pages
|