开发者

Converting ASP.Net MVC to N-Tier

I recently started learning about ASP.Net MVC and its various features MVC_3_MUSIC_STORE + CODE .

It looks very structured and开发者_如何学JAVA simple to understand.

I was reading about enterprise applications and how they are layered/tiered in different sections

(logical/physical)

I was wondering(for learning ) how to do separate(convert) the above MVC_3_MUSIC_STORE into n-tier or 3 tier application (since we already have a working example) in order to have a clean separation of concerns. I don't have much prior experience in this.

What changes would be required?

What will be different DTO(s) or POCO(s) that would be needed? The above example uses POCO entities around from controller to views. Would it remain same, assuming EF Code first is used.

Also i was wondering what changes will be required if WCF Webservice is introduced as a data access layer. i.e.Instead of retrieving data from DAL ,Clients will request data to and from WCF Webservice. Client can be Web app or WinForms or Sliverlight app.

( [DAL <--> WCF WS] <--> N CLIENTS)

Would be interesting to know about various approaches.

Example code would be helpful and/or examples for same.

Edit 1 - Added

One of the things I noticed was when i move the model classes from Model folder to new project "MYMODEL" I will have to again add reference to "System.ComponentModel.DataAnnotations" and "System.Web.Mvc" in new model project?

How can this be avoided? How can these validations be moved to Business layer?

Converting ASP.Net MVC to N-Tier

Edit 2

Looking for something similar to this Advice For A Newbie About N-Tier Applications


Normally the only change that will be required is that you will provide an implementation of the repository (DAL layer) which will call a WCF web service to fetch the domain models from instead of some EF DataContext talking directly to the database. A change completely transparent to Controllers and Views.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜