Link to home
Start Free TrialLog in
Avatar of poisonGC
poisonGC

asked on

Need help building a Layered Architecture for building a Dekstop application in C# WPF/Winforms

Requirements:
1. Layered Architecture (loosely coupled for maintenance and reusability)
    I)  Entity Framework 6
    ii) Data Access Layer with Generic Repository pattern (Dependency Injection at constructor level)
   iii) MVVM implementing the INotifyPropertyChanged interface for proper Data Binding
   iv) UI - Windows Forms or WPF (Either or Both)
2. The layers like DAL and Generic Repository pattern will be common through many projects mostly reusable except for slightly changes in the EF model

I searched many sites for articles but didn't find any step by step guide for the above.

Thank you
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

The layers like DAL and Generic Repository pattern will be common through many projects mostly reusable except for slight changes in the EF model
I would put this as a WCF service, clearly isolating all the data access logic in this component.
You'll be able to maintain, and most importantly scale it, separately.

Usually, this layer is a bit more than just data access, it will probably isolate your business logic also.
If you do so, then you can feed whatever client application you want (Windows Forms, WPF, Web, Mobile...) keeping the business logic in a centralized point, that you can maintain and scale as needed.

Some objections might arise with the fact that business and data access are under the same umbrella.
In this case, you should simply move your pure DAL logic into a class library, that you can easily mock while testing your Business Layer.

Now that we're talking about mocking and decoupling, the same applies to your security logic.
Decoupling your authentication and authorization logic will also allow you not only to reuse it but also to easily mock it while testing the components that depend on it.


In all this, things like EF6 and MVVM that you mentioned are pure implementation details.
Avatar of poisonGC
poisonGC

ASKER

Thanks for the swift response Alex...

Is it better or not to use a RESTful web Api 2 instead of WCF?

About the EF and MVVM, which layer will this be under then?

Appreciate if you could provide me with some links, videos or examples to such implementations which will guide me step by step in achieving the same as I am on the learning curve.
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey Alex,, Thanks once again for your swift response... You reminded me of the EE services when I used couple of years back and had given hope on their services with my recent asked questions leading to dead ends only with unsatisfactory results...

In the mean time I'll check the pluralsight website and If it serves my purpose will subscribe it..

Is there a way I can shortlist you on my EE account for further references?

Thanks once again
If some helpful links were provided having examples or step by step guide instead of referring to another subscription, it would make it more easier and prove time saving and be more helpful.

Thank you
Hi mate,
I'm sorry I didn't go deeper into implementation details in my reply.

My reason behind suggesting PluralSight is that there's a lot to know about those technologies; a lot more than I can teach you in this thread. PluralSight will help you get a very good ramp up and then you can always come back with more questions! :-)

I just hope I made myself clear on the layers separation topic, because that's the main message I wanted to pass.  Everything else is pure implementation detail.

Feel free to drop me a message if you have other questions you would like me to give an input, I'll be glad to do so.

Cheers!
Alex