Questions tagged as 'design-pattern'

2
answers

Sort List by Field String

I have a list with attributes, of which I have the field of evaluations, containing: Excellent, Good, Regular, Bad, and Poor. The information for this field I get from consuming a REST API using JSON. Example: IEnumerable<minhaEntidade...
asked by 04.06.2018 / 22:49
1
answer

Generate system logs in PHP [closed]

I need to generate a text document of type .txt containing information about changes made to a web system. This information is about user activities such as registrations, change of registrations, removal of registrations and among othe...
asked by 14.05.2017 / 21:58
1
answer

DOM element identification pattern

What is the pattern of HTML identifier names, eg: <form id="alterar-nome-form" th:action="@{/conta/alterarnome}" th:method="put"> </form> Or <form id="alterarNomeForm" th:action="@{/conta/alterarnome}" th:method="put">...
asked by 24.09.2015 / 15:54
1
answer

Design pattern or best practices for dealing with files on virtual disk

Is there a standard or best practices for handling shipping, storage, file publishing, and access control? Environment example: I have a system that will need to have a registration for Calls and News and both need to allow insertion of at...
asked by 26.11.2014 / 02:47
1
answer

Pattern Builder Multiple Returns

I have a class builder that is responsible for returning an object it builds: public class ObjetoBuilder { private Objeto objeto; public ObjetoBuilder() { objeto = new Objeto(); } public ObjetoBuilder adicionarId(...
asked by 28.09.2018 / 13:53
1
answer

Project Standards: Singleton

I know that Singleton guarantees me a single instance of a given object. I got this. What creates me doubt would be its use in practice like that. Let's assume the code below, using Singleton with Generics (code taken from t...
asked by 08.12.2017 / 10:23
1
answer

What 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 got a bit confused with these two design patterns , especially when it makes use of the Repository using ActiveRecord. It is worth noting that in th...
asked by 10.03.2017 / 04:00
3
answers

Making queries in a view in the MVC standard is bad practice?

I know that most PHP frameworks use the MVC pattern. Where expensive thing (theoretically) should stay in its place. For example, controllers are responsible for the request and stuff, models are database abstractions, and view is the...
asked by 15.03.2016 / 14:24
1
answer

Am I abusing Strategy Pattern in Java?

In an application for user authentication via Radius I thought it would be interesting to use Design Patter Strategy with Enum. So the code looks like this: public enum TipoAutenticacao { LIVRE("Acesso Livre"){ @Override public Str...
asked by 15.10.2015 / 00:26
1
answer

Google Cloud Messaging and Synchronization Standardization

I'm building a project that will use Google's GCM, something new in my projects, and I would like to know the following. At the time the user registers who will request the first data from the server will be the client, and after the user is...
asked by 04.08.2015 / 15:47