The tag has no wiki summary.

learn more… | top users | synonyms

52
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 ...
35
votes
12answers
3k 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 ...
22
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
8answers
640 views

When does one hard-code actual data values into the code as opposed to using a DB?

A long-standing question for me has been: when do I store data (actual values) in a database table, and when do I store them right in the code? The untold consensus (*) has typically been as such: ...
12
votes
5answers
499 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
905 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
652 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
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
128 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
236 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
5answers
2k 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 ...
4
votes
2answers
371 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, ...
4
votes
4answers
335 views

How to write JavaScript while keeping HTML/CSS out of it

What is / are some recommended ways to write JavaScript as to control behavior of showing HTML on screen, while keeping well-maintainable code? Basically, I started to look for ways to keep HTML/CSS ...
3
votes
3answers
425 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
261 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
174 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
687 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
1answer
108 views

Third Party web controls and tight coupling

Disclaimer: I am not against third-party controls because I believe it's for productivity I have used Telerik asp.net controls, especially the RadGrid because it makes it easier to do CRUD. They ...
2
votes
3answers
470 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
121 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
109 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
100 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
326 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 ...
2
votes
1answer
66 views

Queue of jobs in a different states and with different services around

I need to design a 'queue' of jobs (in a a very much UI oriented application) that can be run by a user and I need some other thoughts to pick optimal approach from ground up. My jobs can be in a ...
2
votes
2answers
140 views

Separation of concerns between objects

I have two objects which work together to provide interaction with HIDs on a machine. One object is responsible for the communication (read/write) to the HID and the other object is responsible for ...
1
vote
2answers
249 views

Email service or simply abstract email out and call from?

Got a fairly large web application in asp.net using C#. Also have a mobile setup using a common api that we wrote to basically share data across both of our apps using web methods and common classes. ...
1
vote
2answers
237 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
215 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
190 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
99 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
58 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
686 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
153 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
142 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
196 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
1answer
291 views

Single responsibility: how does this code cause problems?

Given the following interface interface Modem { public void Dial(string pno); public void Hangup(); public void Send(char c); public char Recv(); } Uncle Bob writes However, ...
0
votes
2answers
230 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
240 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
2answers
47 views

Separating roles authorization and database

Something really bothers me about the way authorization tends to be done with roles in ASP.NET MVC. The way it is normally done is that you have a Users table and a Roles table. A User can have many ...
0
votes
1answer
239 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
406 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
114 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
348 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
406 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
2answers
110 views

API - How to handle scope based functionality?

TLDR; Where and possibly how should I implement scope based logic in the example code? I have got a ASP.NET Web Api. The Api uses OData (on top off REST) for data endpoints and OAuth 2.0 ...
0
votes
0answers
82 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
36 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 ...