separation-of-concerns

ASP.NET - Separation of concerns

Imagine the following scenario - we have Page1 which contains controls Control A and Control B. Say Control A has a button, and on the click of this button we want Control B to react. But we want to do this in an abstract fashion, i.e. we can't have Control B knowing anything about Control A, and vice versa. That way we can develop the...

Need advice regarding layered solution, separation of concerns, etc.

We have a layered application, or at least is in the process of transitioning to one, broken down as follows: Interface (user-interface or application-interface, ie. webservice, etc.) Business logic Data access To make the rest of this question more concrete, I'll describe a specific instance. We have a user interface, which has a c...

Repository Pattern and layering. Where do I apply security?

I am doing my best to design my web app with good separation between the layers. I am using the repository pattern and as such have a SQLObjectRepository which is called by my ObjectService which is called by my Web front end. In my object model, the user is associated with one or more regions which should filter the objects they shoul...

Displaying polymorphic classes.

I have an existing app with a command-line interface that I'm adding a GUI to. One situation that often comes up is that I have a list of objects that inherit from one class, and need to be displayed in a list, but each subclass has a slightly different way of being displayed. Not wanting to have giant switch statements everywhere usin...

The N-Layer POCO/ DTO quandary

When there were only evil datasets and the microsoft application blocks your transfer objects between layers would be either datasets/datatables or DTO/POCO. I belong to the gang that likes using DTO/POCO. Now with this sudden wave of mapping layers like SubSonic, Entity Framework, NHibernate etc, should I still be using my favourite P...

MVC: Data Models and View Models

I've read some MVC advice in the past regarding models stating that you should not reuse the same model objects for the domain and the view; but I haven't been able to find anyone willing to discuss why this is bad. It is my opinion that creating two separate models - one for the domain, one for the view - and then mapping between them ...

applying separation of concerns

Hi I wonder if you think that there is a need to refactor this class.( regarding separation of concern) publi class CSVLIstMapping<T> { void ReadMappingFromAttirbutes(); void GetDataFromList(); } ReadMappingFromAttributes - Reads the mapping from the type T and stores it in the class. Has a name of the list to use and a number of c...

Domain Driven Design, SOC, and entity identification

I've been trying to wrap my mind around DDD and how it can relate to MVC, but I'm having trouble with regards to entity identification. In particular, I'm trying to maintain strict separation between my presentation, domain, and data models. My hangup here is in how I preserve entity identification across these boundaries. To clarify, I...

What to put in your ViewModel

And what do you put in your View? A recent blog from Scott Hanselman about using a special model binder for easier testing led me to think about the following: What do you put in your controller logic building the view model, and what should be put in the view? what he does is this: var viewModel = new DinnerFormViewModel { Dinne...

Separation of concerns in asp.net cause hierarchy mess

I’m designing a back office web site, one that will enable administrators to manage content, products, prices and such. I have two issues I’d like to solve in a base class that each page controller (i.e. code-behind class) will extend, and these are: Storing of ViewState on disk, and User validation. Furthermore, I would like...

How strictly do you follow the n-tier architecture and separation of concerns between the layers in your projects?

I suppose most of the developers have an idea of multi-layer architecture. We have DAL (Data access layer), we have BLL (business logic layer) and somewhere near the end of the road we have our UI. If you have a project which somehow follows these principles, do you keep (or at least try) to keep/put the things where they conceptually be...

How to integrate jBPM and Spring via scripts and EL.

I'm using/anticipating the following technology stack: JSF Seam jBPM Spring Of course, I'd like Seam to access Spring beans directly and have got this much to work fine. I'd now like to move down into jBPM and develop a proof of concept process definition that accesses Spring beans to perform actions and make decisions. To promote s...

What are benefits of serving static HTML and generating content with AJAX/JSON?

http://blog.urbantastic.com/post/81336210/tech-tuesday-the-fiddly-bits Heath from Urbantastic writes about his HTML generation system: All the HTML in Urbantastic is completely static. All dynamic data is sent via AJAX in JSON format and then combined with the HTML using Javascript. Put another way, the server software for Urbanta...

Linq to SQL DTOs and composite objects

I am using a similar approach to others in keeping my LINQ objects in my LINQ data provider and returning an IQueryable to allow filtering etc. This works fine for filtering a simple object by it's ID or other property, but I am having a problem with a join table object that is composed of other child objects //CoreDBDataContext db...

Abstracting Data Access Layer from Business Object

Hi It's nothing new to de-couple the data access code from your business objects, but I'm always on the look-out for the "best way" to achieve something. I have the following classes: Orange - this is my Business Object. OrangeList - this is a List of Oranges. The user would fetch Orange objects from the data store by calling Oran...

Should Business Logic objects have knowledge of their LINQ-to-SQL data objects?

I've looked at several similar questions but I didn't see any that directly applied to me, so forgive me if this is a duplicate. For separation of concerns I'm trying to somehow map my business objects with logic to the LINQ to SQL data objects in the .dbml file (fairly new to this btw). What its looking like though is that my business...

Where can I find information on Authentication and Authorization in the context of Domain Driven Design ?

I'm trying to do things the DDD (domain driven design) way. And boy do I struggle. In all books I read, Authentication is of no concern and not mentioned! I've written my own Authentication and Membership Service which are responsible for registering and logging in users, creating salted passwords etc. I do not use .NET's Membership Pro...

Asp.Net MVC Actions - Separation of Concerns/Single Responsibility Principle

In computer science we've been taught that each method should do one thing and one thing only. I'm a little confused then that we see MVC actions like the following given as examples of good practice: [AcceptVerbs(HttpVerbs.Post), Authorize] public ActionResult Edit(int id, FormCollection collection) { Dinner dinner = d...

Preferred way to "move" an object between lists

I have two separate lists of entities: class EntityCollection : IList<Entity> { //... } EntityCollection Foo; EntityCollection Bar; I want to implement an operation to move an object Qux that is on list Foo to Bar. What's the best way to implement it? As a MoveTo instance method on EntityCollection: public void MoveTo(EntityCo...

How is ENFORCED the separation of concerns in ASP.NET MVC ?

I have been studying, playing with and working with ASP.NET MVC since Preview 1 in 2007 (december). I have been a fan of it since 2008 and I support it all the way. However I keep hearing and reading "ASP.NET MVC enforces a strict separation of concerns", including reading it in Professional ASP.NET MVC 1.0 by Rob Conery, Scott Hanselma...