The tag has no wiki summary.

learn more… | top users | synonyms

51
votes
10answers
3k views

What is meant by, “A user shouldn't decide whether it is an Admin or not. The Privileges or Security system should.”

The example used in the question pass bare minimum data to a function touches on the best way to determine whether the user is an administrator or not. One common answer was: user.isAdmin() This ...
34
votes
10answers
2k views

Is there ever a reason to do all an object's work in a constructor?

Let me preface this by saying this is not my code nor my coworkers' code. Years ago when our company was smaller, we had some projects we needed done that we did not have the capacity for, so they ...
18
votes
4answers
3k views

Do stored procedures violate three-tier separation?

Some colleagues of mine have told me that having business logic in stored procedures in the database violates the three-tier separation, since the database belongs to the data layer whereas stored ...
12
votes
5answers
477 views

Storing in-text metadata in a discrete data structure

I am developing an application which will need to store inline, intext metadata. What I mean by that is the following: let's say we have a long text, and we want to store some metadata connected with ...
7
votes
3answers
723 views

Architecturally speaking, does a database abstraction layer, such as Microsoft's Entity Framework, void the need for a separate Data Access Layer?

The way it was For years, I have organized my software solutions as such: Data Access Layer (DAL) to abstract the business of accessing data Business Logic Layer (BLL) to apply business rules to ...
6
votes
2answers
577 views

Why is using named routes for generating outbound URLs a violation of Separation of Concerns?

What is separation of concerns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little ...
5
votes
5answers
1k views

Is this a good practice or not?

I have a colleague who has come up with a way of 'genericizing' information from a database so that all his web application's drop-down lists can share the same object in his MVC.NET C# code and ...
5
votes
1answer
176 views

Why is CSS3 doing animations?

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. ...
5
votes
2answers
124 views

Should more than one function be used when they do similar, but not identical things?

For example, if I wanted to generate some HTML based on some input. Which is the preferred way out of: <?php function generate_html($type, $input){ switch($type){ case 'paragraph': ...
5
votes
1answer
226 views

Is the separation of program logic and presentation layer going too far?

In a Drupal programming guide, I noticed this sentence: The theme hook receives the total number of votes and the number of votes for just that item, but the template wants to display a ...
4
votes
2answers
346 views

Better OOP in Javascript - multiple methods or methods with options?

Let's say I have an object like this: function Foo() { this.parser = new DataParser(); }; Within Foo I have a method that does something like this: Foo.prototype.getResponse = function(message, ...
3
votes
3answers
404 views

Separation of concerns: Whose concern is this?

My senior reviewer colleague wants me to do the following. We have (on iOS, iPhone) a hierarchy of views in one of our screens. There is a simple rectangle that represents a Business card of a person ...
3
votes
3answers
229 views

Does Exception Handling Violates “Program to Abstraction”? [duplicate]

I am talking based on experience with Java and C#. I do not know if other language have different exception handling implementation. In order to achieve loose coupling, we need our code being ...
3
votes
3answers
165 views

Separation of concerns and security

The system I am developing is designed to have multiple organizations, with users and roles for each organization. Some organizations can interact, some can not, and generally organizations are not ...
2
votes
4answers
625 views

Why Have People Started Deeming it Necessary to Separate JS hooks from CSS hooks in HTML?

Edit: Point of clarificatioon, IDs and classes as separate hooks is just one form of the applied idea in question which is to never use the same hooks for CSS as you do in JS. I've also seen people ...
2
votes
3answers
440 views

Is it completely impossible to have total separation without leakage of any kind in a design? [closed]

For the past week I have been attempting to write a proof-of-concept project using dependency injection, a service layer, unit of work pattern + repository. I am looking to design something that can ...
2
votes
2answers
108 views

Segregating interfaces/concerns to a tree

When working with a single object there are a number of ways to segregate interfaces to it. Breaking it into smaller components that can be treated independently. Breaking it into simpler ...
2
votes
1answer
105 views

Refactoring code to separate concerns [closed]

While programming an object that represent a GUI, the class is a mix of code of following sections: Overrides of super GUI, for behavior customization Implementations of interface contracts, to ...
2
votes
1answer
91 views

Providing an agnostic authorization system

I'm trying to design a small web platform that would host several "applications", with a common user pool. My reflection is now focused on the authorization system. I define an application as an ...
2
votes
1answer
314 views

What kind of abstraction/SoC should I use here?

I am starting a new project, and I want to follow the separation of concerns pattern, and I have been reading on the topic, and now I am in doubt of how I should go about this. Here is how I ...
1
vote
2answers
231 views

Is there a design pattern that describes the separation of a Form from a Model

I am working on a web application implemented in C#, that follows MVC conventions. This application contains a page that allows me to create or update a Wingding. The view passes a complete Wingding ...
1
vote
2answers
209 views

How to refactor code that has 2 concerns

Say I have this code: if ($this->ship == "e") { $this->price->addLine($this->price->base * $this->price->e, 0, "Export"); ...
1
vote
3answers
157 views

Repository query conditions, dependencies and DRY

To keep it simple, let's suppose an application which has Accounts and Users. Each account may have any number of users. There's also 3 consumers of UserRepository: An admin interface which may list ...
1
vote
1answer
98 views

How can I cleanly separate first open tutorial code from my regular display code under OOP?

I have a MVC architecture, and I have the basic views completed. I now need to add the first user tutorial mode into the project. I don't want to add checks for first user state in all the views that ...
1
vote
1answer
56 views

Separate domain entity in small ones

I have the Customer entity, this entity has a huge list of attributes, so you are thinking in separate in small entities (for example: "basic info", "document", "declarations", etc). This approach ...
1
vote
2answers
529 views

MVP Implementation at the UserControl Level

I'm trying to figure out how MVP should be implemented at the UserControl level. I thought I had it, but I ended up reading a blog post that pretty much shut me down. Now I'm back at the start and ...
1
vote
1answer
136 views

Complex fetching of Domain Objects

Usually whenever I want to fetch an aggregate root by ID I just use some type of Repository::findByID(...) function Whenever I started with DDD I thought factories where just a pattern to build new ...
1
vote
1answer
76 views

Extracting domain logic from the forms to which they are coupled?

Many applications do nothing to separate the interface from domain logic. I’ve been programming for a couple decades and have worked at more than a dozen shops and none of them have taken any measure ...
1
vote
1answer
141 views

Add complex customization to form or create two forms?

I'm working in a WPF application that both imports and exports delimited text files. At both ends, there is a UserControl which encapsulates some logic about delimiter configuration. It has some ...
1
vote
2answers
181 views

Is it correct to say that CSS is AOP? [closed]

With selectors being a counterpart to pointcuts, and rules pretty much doing the same as advices do, - can we say that cascading style sheets are adhering to aspect-oriented paradigm ? And a corollary ...
0
votes
2answers
221 views

How to explain to my manager the importance of separation of concerns?

I'm an extremely novice web programmer working at a 2 person shop building websites, and we're in the process of writing a simple website template system in PHP from scratch. My manager is entirely ...
0
votes
2answers
209 views

Should a repository be passed in to the User Interface

In Mark Seeman's Dependency Injection in .NET he injects a repository into his UI layer. I believe that he is doing this so that he can store everything in the UI configuration, however this just ...
0
votes
1answer
214 views

Implementing separation of concerns via MVC

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 ...
0
votes
1answer
141 views

Domain Services vs. Factories vs. Aggregate Roots

After dealing with DDD for months now, I'm still confused about the general purposes of domain services, factories and aggregate roots in relation to each other, e.g. where they overlap in their ...
0
votes
1answer
105 views

Design MVC site such that UI developer can work without access to data tier? [closed]

I'm working on an ASP.NET MVC site (using Team Foundation Service for source control) that I've divided into a few separate projects under one solution: Project.WebAPI (Main entrypoint, contains ...
0
votes
3answers
253 views

What are the steps to grouping related classes into packages

What are the steps needed to be taken to group related classes into packages in Java? In my case, I have about a number of .java files that I'd like to group into 3 packages according to the MVC ...
0
votes
1answer
71 views

terminology for upward devolution from modules to framework

Is there a word for the problem of a framework becoming married to the software modules it supports, for example adding methods to a base class that may apply only to certain subclasses or use cases? ...
0
votes
2answers
402 views

Access functions from user control without events?

On some generic functions, it seems that accessing a function on mainform directly from the usercontrol is easier than raising an event. For example: A function on main form that displays one desired ...
0
votes
0answers
43 views

How to use data shaped by the UI from the ViewModel while keeping concerns separated?

I'm coming from a winforms background and trying to get ahold of MVVM and XAML. Right now I'm wondering how I can take advantage from a data-shaping control (either native or provided by a third ...
0
votes
0answers
30 views

modelling data / UI models in relation with the Data Layer

I have a user interface in Asp.Net MVC, which would for example need to load a list of products to show. Let us assume this calls ProductRepository.GetProducts() . In the data layer, I have a class ...