Y
Y
Yakov Shmidt2016-07-12 11:59:13
Java
Yakov Shmidt, 2016-07-12 11:59:13

How to use DTO pattern correctly?

Hello. There is a small project on the spring, on the timelif view. I have a question about dto. I'm making a "contact us" form. This form has fields: name, subject, mail, message. So, I don’t have such an entity and I don’t need it, should I create a dto for this? and if I create a dto, then should I do all the appeal to the view through dtohi? Question more at the convention for the project

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kosarev, 2016-07-12
@jaxtr

In this case, it will not be a DTO, but a Value Object, which in Spring WebMVC is marked with the @ModelAttribute annotation.
Using a Value Object instead of a set of query parameters is definitely better and more convenient.
You can read about it here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question