n-tier-architecture

Does DI make sense in a desktop app?

一个人想着一个人 提交于 2019-12-05 23:12:41
问题 I am about to create a Desktop App (with .NET windows forms) Essentially, I want to create an n-tier app but I also want loose coupling between layers. However, I am not very sure if this is a good approach for windows forms And now I just wonder if it would be really a wise choice to use any IoC (StructureMap, Ninject, Spring.Net), I have used them before for Asp.Net web applications but what makes me doubt now is the fact that working with windows forms my business entities will persist

Dependency Injection - Does it violate Separation of Concerns?

我的梦境 提交于 2019-12-05 18:00:52
Does Dependency Injection violate the Separation of Concerns as it pertains to an n-tier architecture? Suppose you have the following projects: MyApp.Data MyApp.Business MyApp.Web If I were to use DI to tell the Business Layer which Data Context to use, wouldn't this violate SoC? This would mean the UI (MyApp.Web) would have to have knowledge of the Data Access Layer (MyApp.Data) to tell the Business Layer (MyApp.Business) which context to use, right? public class WebForm { public void Save(Object dto) { BusinessObject bo = new BusinessObject(Data.MyDataContext); bo.ValidateAndSave(dto); } } I

Layering a WCF Service the right way

人走茶凉 提交于 2019-12-05 04:56:28
问题 My question is more of an architectural nature, less involved with the actual implementation. I have build an API based on WCF, but can't really decide on how to separate the PL from the BL. I have made my service thin, so that it holds only a minimum of implementation, something like: public TagItemResponse TagItem(TagItemRequest request) { return (new ItemTagRequestProcessor()).GetResponse(request); } Than of course the first question arises, in what layer do the RequestProcessors belong? I

Need Help in applying SOLID principles

陌路散爱 提交于 2019-12-05 01:09:40
问题 Really impressed with Juile Lerman's pluralsight course on "EF in Enterprise" and decided to build my demo app. I am using VS 2012 and latest versions of EF,SQL Server and MVC. I am building a demo application which applies SOLID principles. I am doing this to better understand how to implement DI & unit testing. I have used DB first approach for this demo application. It contains only one table named UserDetails and below is how it looks in SQL server. I will use this table for CRUD

Use of BAL in 3 tier architecture?How to call methods from DAL to BAL

拟墨画扇 提交于 2019-12-04 22:31:15
问题 I am a newbie to 3 tier architecture and below is my DAL code public static int Insert(string firstname, string lastname, DateTime dob, string gender,string email, string password) { // bool flag = false; SqlParameter pid; SqlParameter result; SqlConnection con = Generic.DBConnection.OpenConnection(); try { SqlCommand cmd1 = new SqlCommand("Insertreg", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@FirstName", firstname); cmd1.Parameters.AddWithValue("

DDD & client-side validation

白昼怎懂夜的黑 提交于 2019-12-04 22:04:17
问题 Suppose you have an application that utilizes the domain-model pattern, DDD and lots of other design patterns. assume that we have a number of solutions as listed below: Solution.Model Solution.Repository Solution.Services Solution.Presentation Solution.UI.Web The user experience layer will be Solution.UI.Web and we'll assume that it'll be an ASP.NET WebForms application. how do you enforce client-side validation? There are a number of things to be considered: First and foremost, we shouldn't

Layered architecture and persistence annotations on the model beans?

橙三吉。 提交于 2019-12-04 15:26:01
I would like to follow the separation of concerns design principle in a new Java EE web app. If I understand correctly, this means that I have to keep the technical choices of my DAL (Data Access Layer) invisible from my model/business layer. As I use Spring Data Neo4j, I must annotate my model beans with e.g. "@NodeEntity", an annotation which is specific to Spring Data Neo4J. This seems to mix the model layer with the Data Access Layer. Is this a good analysis I'm doing here? If so, how can I have a model which is independant of my DAL using Spring Data Neo4j annotations? Thanks for your

ASP.NET web application architecture design advice

允我心安 提交于 2019-12-04 14:22:51
问题 previously my ASP.NET web application connects to a database directly using ADO.NET. Now I want to change it to 3 layers, ASP.NET layer, middle web service layer and backend database layer. I think there is benefit that I could abstract data source to ASP.NET front layer, loosely coupled and reduce potential security risks to let external exposed ASP.Net web application to be able to access database directly, etc. Compared with 2 layer architecture with the 3 layer architecture, I met with 2

N-tier architecture design separation of concerns

我的梦境 提交于 2019-12-04 13:14:28
I realize there have already been a number of posts on n-tier design and this could possibly be me over thinking things and going round in circles, but I have myself all confused now and would like to get some clarity from the community please. I am trying to separate a project I created, (and didn't design architecturally very well to start with), out into different layers (each in their own project): UI Business Objects Logic / Business DAL The UI should only call the Logic layer to get its stuff The Business Objects should not call or have references to anything else, just be a way of

EF N-Tier Architecture [closed]

浪尽此生 提交于 2019-12-04 12:42:01
Introduction We require to build a n-tier application, as we would like to share our BL over multiple platforms and only write our DAL once. I've already done some research on this subject. As can be read here in Davide Piras's post: MVC3 and Entity Framework each VS solution must at least have 4 layers. So far so good. He also states that the DAL project is the only project which is allowed to even know that EF is being used. Question 1: I'm assuming, that the interfaces of the 'Interfaces' project are a 1 on 1 representation of my EF entities, am i correct on this? Also, these interfaces