c# - Advice simplifying my Architecture... asp.net mvc -


i have ui layer/ domainservice layer (domain logic , services reside here) , repo layer persistance, use ninject decouple things.

i have kept ui layer simple - delegate tasks service layer, have complex application depends on loggedonuser, therefore crud can quite complex.

my problem though is: have service , connects onto genericrepository.

for example iorder communicates idbrepo order info depending on client accesses order, have ishipping - connects idbrepoand retireves info... gets complicated when 1 service needs call service, both connected idbrepo.

i have managed pull out iusersession , can give each service - seems complicated me...

when setting test have like:

var db = new dbrepo(); var s1 = new orderservice(db); var s2 = new shippingservice(s1,db); 

then extend some/most of services have add iloggingservice , inotificationservice - both need access database too...

note: not looking pure ddd, trying take best of things , make work guess has been problem...

bob cravens truck trackr series of posts read thinking it:

http://blog.bobcravens.com/2011/05/a-net-generic-repository-pattern-with-implementations/

in general don't think it's great idea have interdependent services if can avoid it. if have have consider using dependency injection framework such unity or spring.net or ninject.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -