Most voted "pattern-design" questions
A design standard, from English design Pattern, is a general reusable solution to a problem that commonly occurs in software design.
Learn more…269 questions
Sort by count of
-
89
votes2
answers8108
viewsWhat are the differences between Dependency Injection and Control Inversion?
Sometimes it feels like we’re talking about the same thing (of course, it’s not) when these concepts are being used. What’s the real difference between them? When using one or the other?
pattern-design software-engineering dependency-injectionasked 10 years, 5 months ago Maniero 444,682 -
75
votes3
answers4535
viewsWhy shouldn’t we use Singleton?
You finds on the internet the claim that Singletons are bad. Is this true? Why? Would the problem be generalized to any objects with single instance? Or to anything that has been global? If it is so…
-
71
votes4
answers25411
viewsWhat is addiction injection?
I have heard a lot about addiction injection. The question is: How, when and what to use?
-
67
votes2
answers18428
viewsWhat is MVP and MVVM?
It is very common to talk about the MVC (Model-View-Controller) standard. But the acronyms MVP (Model-View-Presenter) and MVVM (Model-View-View-Model) are very poorly cited. What they are and what…
-
66
votes3
answers2309
viewsIs it right to prefer composition to inheritance?
I’ve read several articles and books of Designer Patterns the expression Prefira composição em vez de herança. I believe it is a rather controversial subject due to the views discussed. In my view,…
-
64
votes4
answers26848
viewsWhat’s the difference between DAO and Repository?
What’s the difference between DAO and Repository? Both are very similar, but in which case it is better to use one or the other? I would like code examples.…
-
61
votes3
answers8159
viewsWhen to use Entity Framework with Repository Pattern?
Lately I have several examples of Repository Pattern homemade on questions about Entity Framework. But the Entity Framework already implements a Repository Pattern, which in this case is the Unit Of…
-
40
votes3
answers1255
viewsWhat is SRP and how is it used?
I know what SRP means Principle of Single Liability. Each class must be responsible for such a thing. What should I do to detect that I am violating the SRP? What I must take into account to apply…
pattern-design software-engineering programming-principlesasked 8 years, 11 months ago Wallace Maxters 102,340 -
38
votes2
answers14936
viewsWhat is Event-Oriented Programming?
What is event-oriented programming? What Differs between Event-Oriented Programming and Object-Oriented Programming? What languages can we cite that are event-oriented?…
-
38
votes3
answers53541
viewsHow does the DAO Standard work?
I researched and read about DAO (Data Access Object Standard), but I’m not getting to understand how it works and how is its structure, it is also responsible for the business rules of an…
-
35
votes3
answers1710
viewsWhat is the role of architecture standards in object orientation?
This question seems to have an obvious answer, but I confess that I still don’t get the idea myself. I am working with object orientation since 2011, mainly focused on web development. As soon as I…
-
33
votes5
answers5756
viewsWhat is Design Pattern?
I am starting my studies in Software Engineering, I have heard a lot about the term Design Patterns and its applicability and importance in software projects. Below is a definition: In software…
-
28
votes1
answer3003
viewsHow does the Repository standard work?
I was doing a study on a framework in PHP called Symfony. When I was studying about the database research, I realized that there are some differences in relation to the searches, as in frameworks as…
database oop pattern-design software-engineering repositoryasked 8 years, 11 months ago Wallace Maxters 102,340 -
28
votes1
answer1626
viewsWhat is Flyweight Pattern?
Researching a little to better understand the logic that leads strings in Java to be immutable, I found out that "internment" of Strings is an example of the pattern Flyweight. In accordance with…
pattern-design software-engineering memory-management immutability flyweightasked 8 years ago Anthony Accioly 20,516 -
27
votes3
answers11642
viewsWhat is the definition of the term coupling?
What is the meaning of the terms high/low coupling in object-oriented systems development or object-oriented programming (POO)?
-
27
votes4
answers5927
viewsWhy split layers? What are the benefits of a multi-layered architecture?
There are n types of architectures that use layer separation, an example: Model-view-controller (MVC). How creating multiple layers can help my application? What are the advantages of doing this?…
pattern-design software-architecture software-engineeringasked 10 years, 4 months ago Laerte 22,243 -
27
votes3
answers983
viewsWhat is a variable?
We always use variables all the time in codes. Is it the same thing we learn in mathematics? How does the variable work?
terminology variables pattern-design software-engineering computer-scienceasked 7 years, 9 months ago Maniero 444,682 -
23
votes2
answers2818
viewsWhat is "Inversion of Dependency Principle" (DIP)?
I’m getting to know the beginning now SOLID: S Single Responsabilty Principle The Open/Closed L Liskov Substitution Principle I Interface Segregation D Dependency Inversion Principle However I could…
-
22
votes3
answers1335
viewsWhat is the advantage of dependency injection in relation to an object instance?
I’ve been reading and rereading What is addiction injection? but in the end I could not perceive an advantage of the injection of dependence in relation to an object instance. What is the advantage…
-
21
votes1
answer5221
viewsHow does Design Pattern Observer work and how does it implement it?
I am in doubt regarding Design Pattern Observer, when its working and how to use(present practical example).
-
21
votes1
answer631
viewsWhat is the difference between DI, Factories and locators?
Already I asked about addiction injection. It is widely used. In my opinion it is even abused. But I saw that in her place you can use Factories or locators. What would they be, what are the…
pattern-design software-engineering dependency-injectionasked 7 years, 7 months ago Maniero 444,682 -
21
votes5
answers1899
viewsIs dealing with business rules in the model bad practice?
This is something that may seem simple, but it is not. After all how to define whether a rule should be in the service layer or in the model itself? To illustrate, think of the following: We have an…
-
21
votes1
answer329
viewsHow to implement memoization in a PHP function?
I saw it today in a reply the following code: function fibonacci($n) { $a = 0; $b = 1; $c = 1; for ($i = 1; $i < $n ; $i++) { $c = $a + $b; $a = $b; $b = $c; } return $c; } echo fibonacci(100)…
-
21
votes3
answers10118
viewsWhere should the business rule be in the MVC standard?
A few weeks ago I started to study in depth ASP.NET MVC and, as I came from Windows Forms, there are some things that have not been very clear yet. In all the applications I’ve done so far in this…
-
19
votes1
answer1697
viewsWhat is Fluent Interface?
I quickly read some articles about Fluent Interface but I could not clearly understand this pattern. Definition Wikipedia: It is an implementation of an API oriented to object that aims to provide…
-
18
votes3
answers8119
viewsWhat are the best practices in field validation?
I created an example to illustrate my doubt regarding field validation, the example is composed of two classes Pessoa and ModelPessoa. The class Pessoa has the following attributes: Nome, Idade,…
-
17
votes3
answers3943
viewsAlternatives to MVC for web applications
Context (TL; DR) When we talk about architectural design patterns, we usually talk about MVC. For the web, we usually use something like the following image: So much so that much of the frameworks…
-
17
votes5
answers1347
viewsSingleton or class and statics?
I was researching some projects in .Net and Java and from what I understand of the benefits of Singleton, I found it unnecessary to use it. For example: in a project it was used to instantiate…
pattern-designasked 10 years, 4 months ago Gustavo Piucco 2,401 -
17
votes1
answer2610
viewsWhat is the Adapter standard?
What is and how the Adapter standard works in Java, I am trying to understand this pattern because I will use it in a project.
-
17
votes1
answer429
viewsHow to identify the anti-standard TOCTOU? How to avoid/remove it?
I was reading an answer about transform vectors into lists in Java, when we comment the AIR directs me to the source codes of JDK9. There in the sources, I have the following comment: ListN(E...…
-
16
votes1
answer4185
viewsWhat is the difference between the Data Mapper and Active Record Patterns?
I would like to know the main differences between these two Patterns design. I have this question because when I heard the news about Cakephp 3.0 I saw the change of the Pattern design used by the…
-
16
votes3
answers3377
viewsHow does the MVC framework for Desktop applications work?
I have seen many web projects like php frameworks, Asp.net, however I read in some places that MVC came before the web, it was aimed at developing desktop applications, however I did not find…
c++ mvc pattern-design software-architecture software-engineeringasked 9 years, 2 months ago Guilherme Nascimento 98,651 -
16
votes1
answer1422
viewsListeners are an Observer implementation?
I’m trying to understand the concept of Observer and its implementation, and I ended up finding this example where it is used listeners instead of classes observable and observer: This graph has…
-
15
votes2
answers4119
viewsDifference between DTO and Viewmodel?
In this question we can see that it is Viewmodel: What good is a Viewmodel in ASP.NET MVC? In this other question we can see what DTO is: What is a DTO? But after all: What is the difference between…
-
14
votes2
answers3182
viewsWhat is the difference between Simple Factory, Factory Method, Abstract Factory?
What are the main differences between these design patterns? In which situation can one pattern be better than the other?
-
14
votes3
answers8566
viewsWhat is CQRS and how to implement?
CQRS (Command and Query Responsibility Segregation) is one of those acronyms that we come across and we can’t fully understand its meaning and use. What is CQRS and how to implement?…
-
14
votes2
answers481
viewsWhat are the Types of Ioc?
Reading the Book "Pro Spring Security" by Carlo Scarioni of Editora Apress, 2013 edition, I came across the following text that left me confused about Ioc: The basic idea of DI, a type of Inversion…
-
14
votes2
answers625
viewsIs it really necessary to use mutator and access (Setter and getter) methods in PHP? What about performance?
I’ve been noticing that most other libraries use the methods setters and getters (hereinafter referred to as mutator and accessor), to change the property of some classes. For example: class User {…
php performance pattern-design encoding-style getters-settersasked 8 years, 9 months ago Wallace Maxters 102,340 -
13
votes3
answers6240
viewsWhat would be the best way to make a CRUD for a framework in the most generic way possible?
I’m studying to make a CRUD for a framework but I’m trying some problems to be able to do it in the most generic way possible. For example: have a class Pessoa() I want to do CRUD by passing only…
-
13
votes1
answer8955
viewsInheritance in relational database
one of the great challenges in developing object-oriented software is to abstract the data from its base to power-like objects better manipulate them, today the available ORM frameworks make this…
-
13
votes4
answers1574
viewsDatabase and transaction control in value transactions
In my project I need to develop a system of transactions where the user will put credit and the services he hired will consume these credits. I built the following structure but I don’t know if it’s…
-
13
votes2
answers1215
viewsWhy create an interface for each DAO?
I see a lot on the Internet the creation of an interface for each system DAO. I understand the importance of using interface mainly for an easy implementation exchange, I have even found an…
-
13
votes1
answer1308
viewsWhat are the design standards for Serviceprovider and Servicecontainer used in Laravel and Symfony?
In frameworks Laravel 4 ou 5 and Symfony, I realize that there are two classes that are essential for the operation of the whole system: Servicecontainer and Serviceprovider. It seems to be a way…
-
12
votes2
answers5287
viewsHow to implement the Repository Standard in C# with EF?
I want to make an implementation of the standard Repository where I will be using the Entityframework and have the following: Interface IRepository: public interface IRepository<T> where T :…
-
12
votes2
answers1688
viewsDesign Patterns in C?
I’ve initiated the development of a system embedded in pure C. The project requires detailed documentation of software and hardware, as well as using the recommended design standards. It is known…
-
12
votes1
answer3213
viewsDomain Driven Design, what is the difference between Domain Services, Infrastructure Services and Application Services
Is it correct to state that business rules should be written within the domain service? If yes, as a domain entity is not anemic, it also implements its business rules, then Domain Service would…
-
11
votes1
answer5272
viewsWhat is a wrapper class?
What is a wrapper class? How they can be useful? Cite examples of use in php or c#, as well as when to use or not to.…
-
11
votes2
answers4415
viewsWhat is "granularity level" and how to identify it?
In the book Design Standards - Reusable object-oriented software solutions by Erich Gamma, in the first chapter introduction we have the following text: "Designing object-oriented software is…
-
11
votes1
answer886
viewsMultiple Controllers with Javafx 2, as a reference to each other’s instance
UPDATED. I am creating a new Java application using Javafx, when programming with Swing I had the habit of creating multiple specialized controllers for the interface, and in Swing I use a…
-
11
votes4
answers277
viewsHow do the objects created following Singleton work?
I would like to understand how objects created work by following the Pattern Singleton javascript design. My main doubts refer to the methods and attributes of this object, where and how to create…