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
-
11
votes3
answers731
viewsWhat is the advantage of using getters/setters in Javascript classes?
For example in this code below I use methods getters and setters in class: class Pessoa { constructor(nome) { this.nomePessoa = nome; } get _nomes() { return this.nomePessoa; } set _nomes(valor) {…
-
10
votes2
answers1641
viewsIs it wrong to leave business rules on controllers?
I see in several code examples this, and even in the "standard" project that is created in visual studio, they leave a good part of the rule in the controller Is it wrong? When to use it? What is…
-
10
votes2
answers1467
viewsMethod to execute when destroying class instance
There is some way to execute a method automatically by destroying a class instance. I have a generic SQL class, where in the constructor I call a method that opens the connection. Only I want to…
-
10
votes1
answer1326
viewsLaravel 5.3 - Events or Observers?
I have some scenarios where I can use Observers to fire a notification, however, for me it would be indifferent to use Observer or create an Event, a Listener and then use this to fire a…
php laravel pattern-design event-listener observer-patternasked 8 years, 1 month ago Fábio Jânio 3,407 -
10
votes1
answer421
viewsWhat are software design antiparks?
Is there a catalog of them for consultation, just as there is for design standards? Antipadrons are the same as bad practices?
-
10
votes2
answers262
viewsCRUD is an architecture standard?
CRUD is a design architecture standard, which can be explained in different views?
-
10
votes4
answers1741
viewsHow to identify and when to use Value Object?
I am studying on Ddds from the books of Eric Evans and Vernon. During reading I came across the implementation of Value Object, I even understood the concept but could not abstract to a real…
-
10
votes1
answer151
viewsIs there any technical reason for the Observer pattern or similarities not to be used independently of the observed object?
We often use things we don’t even think about because it’s like this. I don’t like to put mechanism bumpers on object that is of specific domain. If I have a screen control or a client who has some…
-
9
votes3
answers563
viewsWhich application layer is aimed at processing the most extensive and complex business rules?
I’ve been reading some questions and answers about the MVC standard and I saw that they say that the treatment of business rules in the layer is correct Controller, such as: Check if a record…
-
9
votes1
answer823
viewsWhat is the Null Object standard for?
I asked that question What is the purpose of Emptyiterator? at SOEN, because I found no answers here. Then I was told in a response from the SOEN of a pattern called Null Object. What is the purpose…
-
9
votes3
answers382
viewsDesign Standard for Filters
First, filter in my current context is a list of objects to be used in Combobox type controls so that the user can choose from among the options. My scenario is this: Screen 1 - Has filters of…
-
9
votes2
answers331
viewsHow to implement a "slim" controller
I am working on a prototype of an ASP.NET MVC application, where I want to leave my controller lean (with the least amount of code possible), for such, not making business logic in it, but rather in…
-
9
votes2
answers146
viewsIn what context is the state machine pattern indicated?
I have been researching some state machine implementations and would like to know in which situation the state machine fits and what benefit to use it?
-
9
votes1
answer55
viewsWhat is the default for naming modules (fonts) in Python?
In Java we have the custom of creating fonts with the first uppercase letter for example: Carrinho.java and DetalheCompraFragment.java. But so far I have not found a standard for naming modules in…
-
8
votes2
answers348
viewsSingleton in Javascript
How to implement the Singleton standard in Javascript in a simple and correct way - which assures me that the instance will be unique? I’ve seen somewhat complex implementations, but it wouldn’t be…
-
8
votes3
answers117
viewsArchitectural problem where access to construction methods should be controlled
I have a class for tree that will have the addition of trunks, branches, leaves and fruits. I need the class to give access to certain methods only after others and that the previous ones cannot be…
-
8
votes2
answers592
viewsBest practices regarding the use of access modifiers
How to restrict other classes from accessing certain members (methods, variables/fields, nested classes/interfaces) one-class? I would like to know the best practices for using the access modifiers…
-
8
votes3
answers446
viewsCould someone explain to me the term "Specification Pattern", applied in Javascript?
I did some research on the net, I found this website with valuable information. I work a lot with conditionals using javascript, see an excerpt of my function that receives radiogroup as a parameter…
-
8
votes1
answer1772
viewsWhat is Viewholder Pattern?
I’m implementing a RecyclerView on Android and I noticed that it is necessary to create a class called ViewHolder. This class seems to be a design standard called Viewholder Pattern, and my doubts…
-
8
votes2
answers248
viewsAlternative to Observable and Observer in Java 9
For testing purposes, I am porting an application from version 7 to version 9 of Java. This application has some features that use Observer and Observable. I realized that both became obsolete:…
java pattern-design characteristic-language observer-pattern java-9asked 7 years, 1 month ago Homer Simpson 3,001 -
8
votes1
answer1041
viewsCQRS - When to use and why to use?
What are the advantages of using the CQRS (Command/Query Responsibility Segregation) standard? What would be the disadvantages ?
-
8
votes1
answer231
viewsHow to use the 9th rule of Object Calisthenics in PHP?
Object Calisthenics making a translation into Portuguese means "programming exercises", and consists of 9 rules created by Jeff Bay in his book The Thoughtworks Anthology. The Object Calisthenics is…
-
7
votes1
answer716
viewsWhat are the right practices to handle events in PHP?
I created some classes and an interface to manipulate events for a small MVC application. My intention is to implement the Observer standard, but I do not know if it agrees, since I still confuse…
-
7
votes2
answers358
viewsReference in Flyweight design pattern
There’s something about Desing Pattern Flyweight that’s really getting me confused. Briefly, the pattern says that to save memory in a situation where you use several similar objects, you use a…
-
7
votes1
answer915
viewsValidation of business object avoiding/reducing use of if’s and Else’s
I have a problem where I have three types of employee (Funcioa, Funcionariob, Funcionarioc), all will be recorded in a table called Funcio and their respective relationships, however, these types…
-
7
votes1
answer1621
viewsWhat are web Workers and how to use them
Through researches I understood that Web Workers allow the simultaneity of processes in Javascript. It would be like firing a thread Javascript that updates the View. It can be considered that it…
-
7
votes2
answers189
viewsWhich Exception should I release according to each situation?
In PHP, we have several types of exceptions that can be released. Among them: BadFunctionCallException BadMethodCallException DomainException InvalidArgumentException LengthException LogicException…
-
7
votes1
answer146
viewsCan Observer be considered encapsulation break?
Observer use of abstraction and interfaces. Let’s assume that a Observer "assists" the state changes of certain classe and informs them to another external agent, we may consider this a…
-
7
votes2
answers408
viewsWhat is Strategy Pattern?
I was reading about Strategy Pattern, however, I could not understand it very well and I was confused about its functioning. Doubts What is the Strategy Pattern? In which scenarios should I use it?…
-
7
votes1
answer86
viewsWhat is a Circuitbreaker?
I’ve seen some definitions about Circuitbreaker, but I still don’t understand how to use it and I have my doubts. What is the best case scenario to be applied? What should be aborted to be fully…
-
7
votes1
answer1032
viewsBasic difference between Abstract Factory and Factory?
I was taking a look at Manual for PHP and saw an example of implementing the standard Factory. Example: class Exemplo { // Método Factory parametrizado public static function factory($type) { if…
pattern-designasked 9 years, 2 months ago Wallace Maxters 102,340 -
7
votes1
answer148
viewsAm I using the Pattern bridge design correctly?
I am studying design standards and would like to know if the following approach is correct for the bridge pattern and if it has how to improve:…
-
7
votes1
answer135
viewsWhat is Task-Driven User Interface?
What is Task-Driven User Interface? Is it the same as Task-Based User Interface? What are the advantages over CRUD?
-
7
votes1
answer6487
viewsHow does a function run automatically without being called?
I can create a Javascript function and call it as follows: funcaoTeste = function() { console.log('Ola funcao teste'); }; funcaoTeste(); To perform the function I need to call her funcaoTeste(),…
-
6
votes1
answer2281
viewsModeling for user permissions
I think this question is more of modeling analysis actually do not know if it fits the pattern of questions discussed by meta.pt.stackoverflow.com. I need to make my system in a way that almost…
-
6
votes1
answer344
viewsStandard that has contributed to the reliability of software that needs to meet complex models such as multi-business models
Taking as an example a software that needs to meet a multicompany model, I would like to know from you if there are any standards adopted to deal with this type of situation? Describing the…
pattern-designasked 10 years, 2 months ago user8052 -
6
votes1
answer368
viewsDesign Observer applied to events
I’m studying design standards and I’m trying to apply a real situation to them. And one example I did was on the event stage: In this scenario every event has participants to register. So, for that,…
-
6
votes3
answers407
viewsHow to implement the standard presented in C# with Entityframework?
I’m thinking of a way to apply the pattern (multi-tenant), raised in that question (Standard that has contributed to the reliability of software that needs to meet complex models such as…
-
6
votes1
answer564
viewsHow does a Dependency Injection Framework work? Are they useful in Ruby?
Java and C# people keep quoting frameworks Injection of Dependencies. I know the pattern of Dependency Injection projects, but never worked with such frameworks. In fact, I have no idea how they…
-
6
votes2
answers125
viewsUse of ';' before starting a function
It has become frequent for me to find codes on github that start like this: ;(function(window){ 'use strict'; })(); Just never understood the following. What is the purpose of using the ';' before…
-
6
votes1
answer195
viewsApplication of more than one Pattern design
I’ve been studying about Patterns design and I thought it was really cool, but there was one thing I couldn’t understand. Regarding Patterns design, can I apply more than one of them to the same…
-
6
votes1
answer134
viewsAuthorization in class Ibraries
Doubt I’m with a project in which all business rule is encapsulated in a set of DLL’s with 3-layer architecture. I would like to know, what is the best approach to authorization control in these…
-
6
votes2
answers1131
viewsHow does the (anti-)EAV (Entity Attribute Value) standard work?
I would like a functional example, because I do not understand very well this dynamic relationship of creating table of types, with table of data, a dynamic relationship, that many consider…
-
6
votes1
answer53
viewsClass standards
I’m not getting literature in Portuguese, so I found an article in English that I didn’t quite understand the concept, someone could help me by explaining the differences: Writing a Class with the…
-
6
votes1
answer1880
viewsMVC versus MVVM
I cannot differentiate between both MVC or MVVM. What really differentiates the MVC from the MVVM? In job interviews, sometimes they ask you exactly that, how do you differentiate one from the…
-
6
votes1
answer90
viewsUsing static factory methods instead of constructors
I’ve been doing some research on this subject after I read in Joshua Block’s book, Effective Java, Item 1, about the use of static factory methods rather than building builders. There in the text he…
-
5
votes2
answers310
viewsStatic Methods in Factory Method
I’m creating a class using Factory Method and I came up with the following question:. The use of static methods in Factories? In many examples I found we have to create an instance of the class…
-
5
votes1
answer340
viewsWhat is the correct way to declare a chain of methods and prevent the same method from being used outside the scope?
In my last questions I was creating some methods to automate some queries. It’s legal, but now I need to control access to methods by specifying a sequence. When using the method Select(), i cannot…
-
5
votes2
answers4825
viewsHow to apply the Singleton pattern correctly?
The class PEHandlerService need to have a single instance and do not want to use synchronized because of the slowness, I developed the following code: public class PEHandlerService extends…
-
5
votes1
answer230
viewsSpring and EJB have the same features?
Spring and EJB have the same features? If not, you can use both in the same application?