Questions tagged as 'design-pattern'

0
answers

What is the best Design Pattern for Java Logger?

I would like to know which is the best choice to implement loggers in Java. Currently I have used dependency inversion as the following example: @Controller @RequestMapping("/"); public class HomeController { private final LoggerImpl lo...
asked by 02.03.2017 / 17:44
1
answer

Creating Python objects from the database

I'm learning Python now and I want to create an object from the information I get from the database, just passing the user ID. I'm using SQL Azure and the pyodbc driver. It's working fine, but I wonder if this is the right way for this kind o...
asked by 23.03.2017 / 00:18
0
answers

What is the correct way to register one to many with DDD

I have studied DDD and mounted a similar architecture to the books and examples I have read. So far, when I'm going to do a crud, when I write I run something like this: UI : The display layer fills an object with the screen data (DTO,...
asked by 29.11.2016 / 16:04
0
answers

How to pass parameters to a query in a repository?

I'm creating a series of classes that return listings in Java (Android). I'm worried about the format of the parameters that will be passed. My initial approach has been to pass Map with parameters, this way I can add or remove paramet...
asked by 22.11.2016 / 18:01
0
answers

Alternatives to global variables

What would be the best practices for avoiding 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?     
asked by 20.09.2016 / 15:58
0
answers

Difference 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 is very reminiscent of the facade pattern, but it speaks to procedures: Organizes bu...
asked by 09.05.2016 / 01:26
1
answer

How to start a ConsoleApplication that generates all objects in the database equal to CodeFirst

Hello! to all I'm starting a project in Console Application in C #, I've read a lot about Entity Framework, Code First, Migrations. The purpose of this project is to generate all the tables of a database schema in Data Models, I ask your h...
asked by 20.04.2015 / 18:30
3
answers

Implementation of generic CRUD

I have the following class CRUD which is generic: public abstract class CRUD { protected string tabela = null; protected object classe = null; public CRUD() {} public virtual void insert() { //código } public virtu...
asked by 02.01.2015 / 19:41
4
answers

API project with many layers [closed]

I'm studying about API. I saw a design pattern with these layers: I found the AppServices and DomainServices layers unnecessary. For me the ideal would be to create only one layer of Services where my entire business rule would be OR...
asked by 04.11.2016 / 01:47
1
answer

Singleton pattern for communication with database

In PHP when I do a Singleton, an instance is created for every request that tries to open a connection to the database, or instantiating once it "always" will stay in memory for all requests ? example: class Connect{ private static $...
asked by 17.03.2016 / 12:26