Questions tagged [separation-of-concerns]

Design principle that comprises the process of separating a computer program into distinct features that overlap in functionality as little as possible.

Design principle that comprises the process of separating a computer program into distinct features that overlap in functionality as little as possible.

487 questions
108
votes
13 answers

Difference between Single Responsibility Principle and Separation of Concerns

What is the difference between Single Responsibility Principle and Separation of Concerns?
87
votes
4 answers

How to map View Model back to Domain Model in a POST action?

Every article found in the Internet on using ViewModels and utilizing Automapper gives the guidelines of the "Controller -> View" direction mapping. You take a domain model along with all Select Lists into one specialized ViewModel and pass it to…
49
votes
7 answers

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…
Erik Forbes
  • 35,357
  • 27
  • 98
  • 122
45
votes
3 answers

Reactjs separation of UI and business logic

I am new to react and I find it sore in the eyes to look at the component flooded with lots of functions and variable initializations together with the UI. Is it possible to separate them? Instead of the default setup, like below. How do I separate…
sabunan
  • 537
  • 1
  • 5
  • 11
37
votes
3 answers

How to separate web components to individual files and load them?

I have a web component x-counter, which is in a single file. const template = document.createElement('template'); template.innerHTML = `
John Doe
  • 2,225
  • 6
  • 16
  • 44
31
votes
2 answers

Does validation in CQRS have to occur separately once in the UI, and once in the business domain?

I've recently read the article CQRS à la Greg Young and am still trying to get my head around CQRS. I'm not sure about where input validation should happen, and if it possibly has to happen in two separate locations (thereby violating the Don't…
stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268
27
votes
2 answers

Rails: Including a Concern with a constant within a Concern

I have concern in which I store constants: module Group::Constants extend ActiveSupport::Concern MEMBERSHIP_STATUSES = %w(accepted invited requested rejected_by_group rejected_group) end And another concern that I wish to use these…
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
22
votes
2 answers

How to use Bootstrap whilst maintaining semantic HTML markup?

Bootstrap provides classes such as text-left (Alignment classes), text-lowercase (Transformation classes) etc, which is the same as defining inline-styles (not technically, but logically). In an alternative methodology such as bem, it imposes that…
d4nyll
  • 11,811
  • 6
  • 54
  • 68
21
votes
6 answers

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…
User
  • 30,403
  • 22
  • 79
  • 107
21
votes
2 answers

When to use JavaScript template engines?

Here is an example of JavaScript template from Ben Nadel's demo single page long-lived AJAX application taken from: [source]