Enterprise Architecture Overhaul

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
I'm getting ready to embark on a very, very large implementation of NC for client. One of the common security requirements of large enterprises is to dissallow direct database access from a web application in the DMZ. My client has this requirement and my client is commited to NC. This means I need to put all data access behind a WCF service layer. Not a trivial task.

I'm going to be splitting NC into tiers. I have done some cursory refactoring of the NC business logic layer, moving all data access to its own assembly and moving all of the "manager" classes to what I call a repository layer, in it's own assembly. The main problem I see at this point is that HttpContext is used heavily in the data access, mostly for caching and there's a lot of coupling with the business logic layer in the "manager" classes as well.

I figure that NC was developed for performance and not enterprise requirements, so I'm definately not complaining about the NC architecture. This is a great platform and I appreciate how it's built. With that said, I need to "enterprisify" this cart and wondered if anyone else has done something similar. Any advice/suggestions/warnings would be much appreciated.
13 лет назад
Hi Donnie,

You didn't mention what version of nopCommerce you are planning on using (I'll assume using 1.70+ - uses entity framework).

My suggestion would be to split out the current businesslogic assembly into:

1. Entity Framework Repository Layer
2. WCF Service Layer
3. Business Service Layer
4. Web App / WPF App etc.

Two things will make this flexible
1) Program against interfaces
2) Use dependency injection

For example.

EFRepo implements IRepository
WCF Service layer implements IRepository (has dependency of IRepository)
Business Service Layer implements IService (has dependency of IRepository)
Web App (has dependency of IService)

Effectively the WCF Service layer will just serve as a wrapper around calls to the EFRepository (hence it's dependency on IRepository)

This gives you the flexibility to use EFRepo initially and swap out the services you need to use WCF. Since both EFRepository and WCFService implement IRepository, this would not require any changes to your business service layer class.

I recommend using the StructureMap IoC tool.
13 лет назад
This is good advice. I'll report back as I get deeper into it. Thanks for the quick response.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.