Structure of Java projects

Asked

Viewed 119 times

-4

I’m having doubts where I work, there are many projects with many different classes, and they use patterns that I didn’t learn in college.

Patterns like: DTO, Canonico, Entity.

Within these "formats" of classes, there are other classes that are Builders and converters (Dto pra Canonico, Canonico para Entity, Canonico para Dto)

One can explain further by sinking what these patterns are and how each class works(DTO, Canonica, Entity).

PS: The Entity I already know how it works, I just put to say everything we use here.

1 answer

0

Design patterns are also known as Design Patterns, so when you hear this term, you can be sure you’re referring to the same theme. The goal of design standards or Patterns design is to make reusable components that facilitate standardization, allowing agility for recurring problem solutions in system development. There are several types of project patterns currently, explain to you what each one of them here would be very complicated, as it is a very long and comprehensive theme. I suggest from one read on that document. https://www.devmedia.com.br/entendendo-os-conceitos-dos-padroes-de-projetos-em-java/29083

DTO - Data Transfer Object is a widely used project standard in Java for transporting data between different components of a system, different instances or processes of a distributed system or different systems via serialization. The idea is basically to group a set of attributes into a simple class in order to optimize communication. Ex : if Voce has a class with 50 attributes, and in a given job, you need to load only 3 of them. What to do ? Thinking about improving the performance of the process, a DTO is created (which is nothing more than a common class), where you will receive the data of this class passing only the 3 attributes that Voce wants to use. https://www.devmedia.com.br/diferenca-entre-os-patterns-po-pojo-bo-dto-e-vo/28162

Convert = It is nothing more than a class that will receive a random value and will convert the data of that object in a natural way. Generally used in JSF projects... When working with Selectonemenu (or Selectmanymenu) and JSF entities, it occurs when we want the value of our Selectitem to be the entity itself, not the "id" of it. When populating a type of object you usually have a reference to it in the "field" be it an id, email, etc. Generally Cvoce wants to work with it completely and not with pieces of it. Then the convert class converts that value from the screen to an entity type object. http://www.rponte.com.br/2008/07/26/entity-converters-pra-da-e-vender/

About Modelo Canonico I know very little, but it takes a cool article I found here on the net. https://sensedia.com/blog/soa/o-que-e-modelo-canonico/

Bons Estudos

Browser other questions tagged

You are not signed in. Login or sign up in order to post.