Thanks a lot, that and Any look interesting...

On Sat, Oct 4, 2008 at 2:33 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote:

> Take a look at many-to-any
>
>
> On Sat, Oct 4, 2008 at 8:22 AM, Miika Makinen <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>> Continuning my NH practice (using activerecord)... I'd like to map a
>> strategy as value object like:
>>
>> public interface IStrategy { ... }
>>
>> public class StrategyOne : IStrategy { ... }
>>
>> public class StrategyTwo : IStrategy { ... }
>>
>> [ActiveRecord]
>> public class Entity
>> {
>>   private Entity(){}
>>   public Entity(IStrategy strategy) { ... }
>>   protected IStrategy { get; set; }
>> }
>>
>> Ideally my table would have a varchar describing the strategy... e.g. like
>> table-per-class-hierarchy but the hierarchy is in the nested class, not the
>> parent. Nothing else comes to my mind but to add a string Property to Entity
>> and then use some factory to create the strategy when reading the entity
>> from the db. Could there be some neat way that I'm missing?
>>
>> Cheers,
>> Miika
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to