-
as seen on Programmers
- Search for 'Programmers'
I'm creating a question to see if my understanding of MVC separation is correct, I haven't been able to find a clear answer anywhere online. So is this the right way to implement it (in Java):
I would have 3 .java files, one each for Model, Controller, View.
I would put all the classes related to…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
What is the difference between Single Responsibility Principle and Separation of Concerns?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am new to mocking and dependency injection and need some guidance.
My application is using a typical N-Tier architecture where the BLL references the DAL, and the UI references the BLL but not the DAL. Pretty straight forward.
Lets say, for example, I have the following classes:
class MyDataAccess…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to be a Good Developer and separate my concerns out. I've got an ASP.NET MVC project with all my web code, and a DAL project with all the model code.
Sometimes code in the DAL needs to check if the current user is authorized to perform some actions, by checking something like CurrentUser…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
Like what the title says, why are there animations in CSS3?
With basis from the "rule" of separation of concerns, HTML is the content, CSS is the style, and JavaScript is the interactive component. And by interactivity, one can conclude that anything moving due to any interaction, user or non-user…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
It is probably just me, which is why I'm asking the question. Information Expert, Tell Don't Ask, and SRP are often mentioned together as best practices. But I think they are at odds. Here is what I'm talking about:
Code that favors SRP but violates Tell Don't Ask, Info Expert:
Customer bob = .…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
Problem Summary:
Long story short, I inherited a code base and an development team I am not allowed to replace and the use of God Objects is a big issue. Going forward, I want to have us re-factor things but I am getting push-back from the teams who want to do everything with God Objects "because…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I like the extnesibility point of MVC, allowing view models to implement IValidatableObject, and add custom validation.
I try to keep my Controllers lean, having this code be the only validation logic:
if (!ModelState.IsValid)
return View(loginViewModel);
For example a login view model implements…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
A class that performs both computations and data logging seems to have at least two responsibilities. Given a system for which the specifications require heavy data logging, what kind of design patterns or architectural patterns can be used to avoid bloating all the classes with logging calls every…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
Recently I've noticed myself implementing pattern similar to the one described below. Starting with interface:
public interface IUserProvider
{
User GetUser(UserData data);
}
GetUser method's pure job is to somehow return user (that would be an operation speaking in composite terms). There…
>>> More