Try fast search NHibernate

11 March 2010

ConfORM : DDD API, Proposals ?

The ConfORM architecture allows a substitution of the “mapping-elements-drive”.

In the actual implementation I’m using a class named ObjectRelationalMapper where I’m using ORM terminology:

public interface IObjectRelationalMapper
{
void TablePerClass(IEnumerable<Type> baseEntities);
void TablePerClassHierarchy(IEnumerable<Type> baseEntities);
void TablePerConcreteClass(IEnumerable<Type> baseEntities);
void TablePerClassHierarchy<TBaseEntity>() where TBaseEntity : class;
void TablePerClass<TBaseEntity>() where TBaseEntity : class;
void TablePerConcreteClass<TBaseEntity>() where TBaseEntity : class;

void Component<TComponent>();
void Complex<TComplex>();

void Poid<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
void ManyToMany<TLeftEntity, TRigthEntity>();
void ManyToOne<TLeftEntity, TRigthEntity>();
void OneToOne<TLeftEntity, TRigthEntity>();
void Set<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
void Bag<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
void List<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
void Array<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
void Dictionary<TEntity>(Expression<Func<TEntity, object>> propertyGetter);

void Cascade<TFromEntity, TToEntity>(Cascade cascadeOptions);

void PersistentProperty<TEntity>(Expression<Func<TEntity, object>> propertyGetter);
}

I would read some proposal for a IDddMapper.

For example

  • instead “Component” use “ValueObject”
  • instead define the cascade behavior between two classes use AggregateRoot
  • Add …

Have you a proposal with a little explication of the expected behavior ?

7 comments:

  1. What would be great is to override the default conventions. For example I would like to IEnumerable instead of List, Baf or Array. In DDD List would be a diseaster so I avoid it as possible.

    ReplyDelete
  2. Override ?
    orm.Bag(...) is not enough ?
    the injection of IPatternsHolder is not enough ?

    If you don't need a IList why you are using it in your classes instead a ICollection ? ;)

    hmmm... to help you better I should open a Google group. perhaps...

    btw... your proposal for DDD based API ?

    ReplyDelete
  3. If you select the new verbiage (ValueObject/AggregateRoot) to define the API. It would be nice to have the other words (Component, Cascade) in the VS tool tip text.

    ReplyDelete
  4. @Jason
    ROTOLF!!
    Sure... just before the first Alpha1

    ReplyDelete
  5. what? if the language is going to change than having some context as to X => Y would be helpful.

    If not the xml comments, then what about depreciated members who call the "real thing"

    [Obsolete("Use ValueObject()")]
    public void Component()
    {
    ValueObject();
    }

    ReplyDelete
  6. No, Jason.
    ConfORM can support more than one entry point.
    If you like you can use ObjectRelationalMapper.
    If you like attribute you can implements a IDomainInspector based on your custom attributes.
    If you like you can implements a IDomainInspector based on EF attributes.
    And... we can implements a IDomainInspector but with a DDD based API.

    ReplyDelete
  7. I don't know how I can help you but I only want to tell you:

    Thank you very much, for your products, docs, posts... I learn something new every day

    ReplyDelete