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
-
3
votes1
answer54
viewsDatabase is not connecting!
My database isn’t connecting. When doing a refctoring of my code following the MVC standard the database stopped working. Follow link with the test files:…
-
3
votes1
answer91
viewsHow to deal with business rules?
I am working on a C# WPF + EF6 application and find myself lost when it comes to reusing business rules. I’m using the standard repository + Unit of work, but I believe that copying-pasting complex…
-
2
votes1
answer601
viewsCan we create the business rule in our model?
What best practice? Create the rule in the model itself or create another class Ex: public class Item { public void Faturar() { //fatura item } } ou public class ItemBLL { public void Faturar(Item )…
-
2
votes1
answer834
viewsIs it advantageous to use the MVC standard in small applications?
I’ve read several articles related to MVC, its advantages in maintaining reusability codes and everything else. But the question is, in small applications it is worth using this standard, because…
-
2
votes1
answer91
viewsHow to add concrete elements in Runtime in the Visitor project pattern?
I have a question regarding Design Pattern Visitor. From my studies, if you want to add a new concrete element to the pattern you should add a new abstract method in the Visitor interface and…
-
2
votes1
answer67
viewsHow to work with more than one dependency on Service class?
I have my class Service calling for GrupoService, in it are most of the shares that refer to a Grupo. Crud(Inserir,Alterar,Excluir,Listar) The only dependency I have in my class so far is the…
-
2
votes1
answer64
viewsWhy use nested classes in Ruby?
Back and forth I see things like: class Teste class Foo end class Bar end end Using classes within classes... Can anyone tell me what this is for? It’s not better and more correct to use modules?…
-
2
votes1
answer158
viewsWhat is the correct way to declare the following class structure and get the respective Entityframework behavior?
I have the following class structure: public class Revenda { [InverseProperty("Revenda")] public virtual ICollection<UsuarioRevenda> Usuarios { get; set; } } public class Empresa {…
c# entity-framework pattern-design asp.net-identity entity-framework-6asked 10 years, 1 month ago user8052 -
2
votes1
answer1405
viewsWhat are the layers and folder names for organizing projects?
I have an application that will need to be developed as follows: Web Application (probably MVC) Web Server Application (WCF - Run on IIS) Client Server Application (WCF Windows Services) Client…
-
2
votes1
answer146
viewsCan the controller send an email?
In a controller called activities, I have a method called reminder. This method, receives an id, looks for that activity based on that id and sends an email to the moderator of that activity with…
-
2
votes0
answers148
viewsComposition and Injection of Dependency
I was studying Design Patterns and I got a question: The concept Composition (OOP), inflicts on the standard "Dependency Injection"?
-
2
votes1
answer411
viewsSingleton standard for database communication
In PHP when I do a Singleton is created an instance for each request that tries to open a connection to the database or instantiating a single time she "always" will stay in memory for all requests?…
-
2
votes1
answer265
viewsStandardization for Mysqli use
I’m researching the use of Mysqli and have seen many articles, but each one always has some particularities about the development pattern, my question has anyone defined a pattern? For example…
-
2
votes1
answer41
viewsMethod returns instance, after setting property
There is a name for the practice or pattern, for this code snippet? Example: <?php class Pessoa { //... public setNome($nome) { $this->nome = $nome; return $this; } //... }…
-
2
votes1
answer149
viewsAlternatives for global variables
What would be the best practices to avoid the use of global variables? How to save the logged in user or a file name that will be accessed in several places for example?
pattern-design software-architecture software-projectasked 8 years, 2 months ago Ricardo Kenji Harasaki 91 -
2
votes1
answer208
viewsAggregations and the DDD
I’m developing a project applying the principles of DDD, I created a class aggregation (Conta) it will contain the classes (Agencia) and (Agente) that as (Conta) have tables in the database. My…
-
2
votes1
answer721
viewsSingleton - What is your function and definition?
I did some research on, I even saw some videos but, I did not understand very well the function or even how it works within Java programming. I am working on a project and a friend advised me to…
-
2
votes2
answers528
viewsStandard Builder design, why should I use it?
This example of design pattern can be found mainly in the book Design Patterns Elements of Reusable Object-Oriented Software, a widely known book both in the academic field and also its content is…
-
2
votes1
answer208
viewsJava - DAO+Hibernate+JPA+JDBC+Tomcat+Servlet
I am advancing the Java course and came across DAO, JPA, Servlet, Hibernate and Tomcat. I understand that DAO deals with the database, that Hibernate is a framework for this, that JPA transcribes…
-
2
votes0
answers712
viewsASP.NET MVC - Alternative to the DDD
I will start building an application let’s say, initially small, about 5 Cruds and only 1 Core (this yes a little more complex in terms of business), but the goal is that it grows over time, using .…
c# asp.net-mvc entity-framework pattern-design software-architectureasked 8 years, 10 months ago Guilherme Ferreira 369 -
2
votes1
answer231
viewsDesign standard to combine data from different databases
I’m taking data from two different databases and need to format this data for Json. The problem is not accessing the two banks and getting the information. The problem is that my class became more…
-
2
votes1
answer509
viewsHow does the Composite design pattern work in theory?
How does this pattern work in theory? What kind of problem does it solve and what utilities does it bring or something?
-
2
votes1
answer347
viewsValidate with object Annotations within a method
I have a Javabean with several attributes that need to be validated. It has an attribute of type Enum, and according to the value of that attribute, the object needs some specific validations, and…
-
2
votes1
answer97
viewsHow does it work and why use the Command project standard?
I’ve been studying the design standards and I’ve come across the Command design standard. I still don’t quite understand how it works, correct me if I’m wrong, but from what I saw why I should…
-
2
votes1
answer144
viewsSkyrim style item system
I am developing a 2D RPG in C# Skyrim style, and I am on the part of implementing the game items, but with many difficulties. I wanted to do a mechanics similar to Skyrim in which you have a range…
-
2
votes1
answer766
viewsCreating Python objects from the database
I’m learning Python now and want to create an object from information I picked up from the database, just passing the user ID. I am using SQL Azure and the pyodbc driver. It is working well, but I…
-
2
votes1
answer112
viewsCreation of anonymous objects vs "named (?)"
I have a class that loga some information in the database I am using it in the following way: new StudyLogRepository().Create(new StudyLog() { StudyId = Study.Id, CycleId = null, DateOccurrence =…
c# asp.net-mvc .net entity-framework pattern-designasked 7 years, 6 months ago Jhonatan Jorge de Lima 1,012 -
2
votes1
answer104
viewsNodejs api with Promisses
I am developing an API in Typescript with Nodejs and Mariadb; when I do an operation with the bank, below I have a if to check if an error has occurred. productDao.save({name:"Notebook Dell",…
-
2
votes1
answer284
viewsClassifications of design standards
My college professor passed the following classification of design standards: Creations: Abstract Factory; Builder; Factory Method; Prototype and Singleton. Behavior: Bridge; Command; Flyweigth;…
pattern-designasked 6 years, 11 months ago Victor Antonio 86 -
2
votes3
answers253
viewsRefactor code using Factory Pattern without using the if-elseif condition
I got the following Factory. In it I urge a class responsible for parsing the file in question. For this parser to be instantiated, it is first verified in the conditions whether that parser is…
-
2
votes1
answer193
viewsInstantiate a Map object only when necessary based on a regex
I have a Factory what instance the PARSER responsible for extracting information from a particular invoice format. To determine the invoice format I use regex. I loop every regex added to Map and…
-
2
votes0
answers54
viewsWPF and MVVM Standard, doubts
I’m studying C# and I’m having to develop a WPF application with the MVVM standard. One question I have about this pattern is in relation to events, I have read in some places that it is not…
-
2
votes0
answers189
viewsGeneric Repository with Dapper
I’m doing a test application where I want to see performance and learn about creating a generic repository with Dapper, well I have some experience when creating a generic repository, but using EF6,…
-
2
votes0
answers37
viewsAction Pattern VS. Controller Pattern: What’s the difference?
I was taking a look at the architecture of a PHP project, and I noticed the use of Action Pattern instead of Controller Pattern. I would like to know the difference between the Standards as well as…
-
2
votes2
answers116
viewsIn Java, what is the purpose of calling interface methods on objects from other classes?
Follow the code I’m studying: public interface Node { public abstract int eval (); } public abstract class Unary implements Node { private final Node child; public Unary(final Node child) {…
-
1
votes2
answers2452
viewsHow to make a database connection using the Singleton design standard
Well I do many web applications, where I all use database, and every time I do a new project, I create a file responsible for making queries with the database (CRUD). Only that I want to change…
-
1
votes1
answer805
viewsModel layer with DAO classes
Work with an MVC application that can be considered large or at least average, as it involves hundreds of features and more than 400 Mysql database tables. As a ORM tool we adopted Doctrine through…
-
1
votes1
answer60
viewsIs there a Pattern design for iOS to consume data from a web-service?
I’m looking for a Pattern design to help standardize the construction of an iOS app that consumes data from a web service. They could say if it exists and the name of this development model?…
-
1
votes1
answer988
viewsWhat are the Android design standards?
Hello, I wonder if there are project standards for Android(Java), coding, etc and their similarities, differences, which is the most used, because I’m wanting to know more about the subject and I…
-
1
votes1
answer36
viewsFOD element identification standard
What is the pattern of HTML identifier names , ex : <form id="alterar-nome-form" th:action="@{/conta/alterarnome}" th:method="put"> </form> Or <form id="alterarNomeForm"…
-
1
votes1
answer248
viewsDesign standard or best practices for handling virtual disk files
There are standard or best practices for dealing with upload, storage, file publishing, and access control? Environmental example: I have a system that will need to register Calls and News and in…
-
1
votes0
answers122
viewsIs it bad practice to mix English and Portuguese in my source code?
I see that some libraries made by Brazilians the codes are always in English. That’s why when I create something, I always do everything in English. The point is, sometimes I see codes where there’s…
pattern-designasked 8 years, 11 months ago Wallace Maxters 102,340 -
1
votes0
answers202
viewsDifference patterns Transaction script and Domain model?
I would like to know the conceptual and implementation difference between these two layers used in the business layer. For me the Transaction script pattern resembles very much the facade pattern,…
-
1
votes1
answer344
viewsHierarchical Object Filter
I have an Asp.net MVC 4.5 C# Razor screen typed by a main class: public class ClassePaiDTO { public virtual ICollection<Filho1DTO> Filho1s { get; set; } public virtual…
-
1
votes3
answers215
viewsProject Improvement in PHP
I’m having a question about the default php project. I have a class DAO which has a selection method, well what happens is that I had to put in this method some HTML code stylized with bootstrap,…
-
1
votes1
answer145
viewsHow to start a Consoleapplication that manages all database objects equal to Codefirst
Hello! to All I am starting a Console Application project in C#, I have read a lot about Entity Framework, Code First, Migrations. The purpose of this project is to generate all the tables of a…
-
1
votes3
answers369
viewsMVC and dynamic language change
I have a MVC that I implement in my projects in PHP. This supports multiple languages and by default gets the active/initial language from the browser. However there are projects that require the…
-
1
votes1
answer558
viewsWhat is the difference between Activerecord and Repository?
I’m reading a POO book in PHP that calls PHP Object Oriented Programming [Pablo Dall'Oglio] and I was a little confused with these two Patterns design, especially when it makes use of Repository…
pattern-design software-engineering active-record repositoryasked 7 years, 8 months ago Matheus Vassoler 13 -
1
votes2
answers137
viewsPrevent classes from changing the state of objects
How to prevent classes from modifying the object state of a class, both Within equal and separate packages? Assuming there is a Pattern to design a java class design that can or even affects the…
-
1
votes1
answer1477
viewsGenerate PHP system logs
I need to generate a text document of type .txt containing information on changes made to a system web. This information is about user activities such as registration, registration changes,…