OK, it's not me getting the wrong end of the stick then.

I was wondering if there was a way of extending their datacontext class
to do it 'manually' but I don't understand their set up enough to
comment at the moment....or databinding in general...to comment.

> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Frans Bouma
> Sent: 22 April 2008 14:13
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] LINQ to SQL and inheritanc....
> 
> > On Fri, 18 Apr 2008 18:04:38 +0200, Frans Bouma <[EMAIL PROTECTED]>
> wrote:
> > >> hmmm....seems a little wierd, it would be nice to query and bind
to
> Dogs
> > >> directly (if you see what I mean).
> > >>
> > >> So I create a form and grid and bind to the Animals base Table
(as
> it's
> > >> the only one I've got and remove all the stuff I'm not interested
> > >> in.....add something to the grid and of course it defaults to the
> base
> > >> type.
> > >
> > >        you can forget databinding if inheritance is involved:
> databinding
> in
> > >grids works with a single set of properties, and typically grids
pick
> either
> > >the first entry in the bound set to determine these or ask the
> ITypedList
> > >implementation of the set, if available.
> > >
> > >        if you have 2 subtypes of animal: Dog and JellyFish, both
will
> have
> > >their own unique properties: what should a grid do: display these
> columns
> or
> > >not? If so, what should be happening when a row represents a dog
and a
> column
> > >specific for jellyfish is changed?
> >
> > This is why I thought it wierd that the inheritance mapping doesn't
> expose
> > the subtypes as 'virtual' tables, then you would bind to them
directly,
> > the mapping would work to map this to the database and everyones
> > happy....the client gets an OO model the database an RDb one....to
me
> this
> > is the point of the O/R mapping....as I say I think this
implementation
> is
> > half baked.
> 
>         I think this is a limitation inside their o/r system. I'm
> currently
> writing a set of templates for our code generator engine to use our
meta-
> data
> to spit out linq to sql files (as our designer has model management
for
> database changes, their designer doesn't, so why not ;)) and I indeed
saw
> that
> there aren't any Table<subtype> typed properties for my subtypes on
the
> datacontext. I haven't tested yet what happens if I do add them
manually
> to
> the datacontext class, if things go bezerk during fetching or not.
> 
>         They also store all discriminator values/types combinations at
the
> hierarchy root, so I think bending their framework to use the subtypes
as
> normal types would probably not work...
> 
>                 FB
> 
> >
> > >                FB
> > >
> > >===================================
> > >This list is hosted by DevelopMentorR  http://www.develop.com
> > >
> > >View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentorR  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at
> http://discuss.develop.com



CONFIDENTIALITY NOTICE

This e-mail (and any attached files) is confidential and protected by 
copyright (and other intellectual property rights). If you are not the 
intended recipient please e-mail the sender and then delete the email and 
any attached files immediately. Any further use or dissemination is 
prohibited.

While MTV Networks Europe has taken steps to ensure that this email and 
any attachments are virus free, it is your responsibility to ensure that 
this message and any attachments are virus free and do not affect your 
systems / data.

Communicating by email is not 100% secure and carries risks such as delay, 
data corruption, non-delivery, wrongful interception and unauthorised 
amendment. If you communicate with us by e-mail, you acknowledge and 
assume these risks, and you agree to take appropriate measures to minimise 
these risks when e-mailing us. 

MTV Networks International, MTV Networks UK & Ireland, Greenhouse, 
Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions 
International and Comedy Central are all trading names of MTV Networks 
Europe.  MTV Networks Europe is a partnership between MTV Networks Europe 
Inc. and Viacom Networks Europe Inc.  Address for service in Great Britain 
is UK House, 180 Oxford Street, London W1D 1DS, UK.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to