Questions tagged as 'design-pattern'

1
answer

Consume repository of entities directly from the application layer

I have a scenario that I need to fetch a list of Active Employees with Entity Framework and display them on the screen (I need to convert to DTOs before displaying - which I do by the Application layer). For a Domain-Driven Design (DDD) scena...
asked by 13.02.2017 / 00:57
1
answer

What is the correct way to declare a method thread and prevent the same method from being used out of scope?

In my last questions I was creating some methods to automate some queries. It's cool, but now I need to control access to methods by specifying a sequence. When using the Select () method, I can not access it again. After the Where () metho...
asked by 14.11.2014 / 21:12
1
answer

Spring and EJB have the same functionalities?

Does Spring and EJB have the same functionality? If not, can you use both in the same application?     
asked by 06.09.2016 / 13:47
1
answer

Templated Method - Is it possible to implement with composition instead of inheritance?

To create a Thread we can either extend the Thread class and override the run() method, such as having a class that implements the Runnable , implement the run() method and pass the reference of an object of this class that we...
asked by 24.04.2016 / 20:15
1
answer

How does session per request work?

There was an idea among developers to use the Session per request pattern - Session per request. Researching the subject, I found some topics in the OS that generally said that the indication was for ORM frameworks. Little practical exa...
asked by 02.02.2017 / 14:06
1
answer

Design Patterns - DTO, POCO, MODEL

What's the difference between DTO, POCO, MODEL? Because I'm developing an application with layered separation, DAL, BLL and UI.     
asked by 27.07.2015 / 21:41
1
answer

Is it correct to declare GET / SET methods within a STRATEGY class?

I was left with a question when I created a design pattern of type Strategy . Is it correct to declare methods GET and SET in a class that implements a Strategy interface? I do not know if I was very clear, follow the example:...
asked by 04.12.2015 / 17:20
2
answers

Static Methods in Factory Method

I'm creating a simple class using Factory Method and the following question came up for me. Is it good practice to use static methods in Factories? In many examples I found there, we have an instance of the Factory class, and I have not...
asked by 08.07.2014 / 14:53
1
answer

Did the functional features of Java 8 make some design pattern obsolete?

Functional programming is said to make certain design patterns (thinking GoF) unnecessary. There's even a presentation showing it somewhere (I'm not looking now because I'm on my cell phone). Have the functional features of Java 8 made any de...
asked by 23.03.2017 / 17:56
1
answer

Proxy project pattern, why use?

This example proxy pattern can be found on Wikipedia. reference: link What I want to know is this: Why should I use this pattern? When should I use it? Why is it good? What would be a wrong way to do this pattern? Are there any f...
asked by 08.06.2015 / 16:26