The model is quite simple. It looks like this:
public class Post
{}
public class Blog : Post
{}
public class Notification : Post
{}
.....
Post only have the information required to address the basic
characteristics.
Each new application/plugin creates its own new type (something I
cannot know in advance). What I need is to be able to handle all of
them as if they were all Post types, and when rehydrating them create
the appropriate object. All objects are being discoverable through
MEF.
The same would work with interface thoughs. Is that something that can
be done?
Regards,
Federico
On 26 abr, 04:36, Ayende Rahien <
aye...@ayende.com> wrote:
> It is very hard to answer such questions in isolations, what is exactly your
> model?
>
> On Tue, Apr 26, 2011 at 2:25 AM, Federico Lois <
federico.l...@gmail.com>wrote:
>
>
>
> > Newbie question ahead. :)
>
> > Lets say that I have:
>
> > public class A
> > {
> > public string Id { get; set; }
> > }
>
> > public class B : A
> > {}
>
> > public class C : B
> > {}
>
> > AFAIK each one of those will be stored as a\1, a\2, b\1, b\2 ... and
> > so on. That requires me to do the query over each type to query over
> > all the entities or to create a polymorphic index (that I couldn't
> > understand the underlying mechanism it uses yet to apply it to my
> > model).
>
> > On the other is it possible to just store all of them under the
> > mynewidentifier\1, mynewidentified\2, ... and so on? Would it step
> > into any particular design pitfall? Is there any facility for that? As
> > it makes sense in my particular case for them to be stored under the
> > same room type.
>
> > The reason why I am asking is because I already have a model with such
> > dependencies and would love to be able to keep it unchanged.
>
> > Thanks in advance,
> > Federico- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -