jeudi 21 juillet 2016

Clean architecture and the use of an ORM

I'm trying to divide my app to 3 layers (Data layer, Domain layer, Presentation layer), The data layer is using ORM (XPO DevExpress). The domain layer is 100% agnostic about the database Technology or the ORM Technology. The data layer and the domain layer is separated by IRepository interface.

public interface IRepository<T>   
{  
    void Insert(T entity);  
    void Delete(T entity);  
    IQueryable<T> GetAll();  
    T GetById(int id);  
}  

In the presentation layer I have a form contain a grid Control and 3 buttons (Add, Modify, Remove).

My first question is : How to make the grid control refresh when I add or remove a record from the database without reloading all the data?(change notification)

The second question is : how to use the power of an ORM and in the same time make my domain layer agnostic of it.

Aucun commentaire:

Enregistrer un commentaire