data-transfer-objects

Using DTOs and BOs

耗尽温柔 提交于 2019-12-07 07:32:51
问题 One area of question for me about DTOs/BOs is about when to pass/return the DTOs and when to pass/return the BOs. My gut reaction tells me to always map NHibernate to the DTOs, not BOs, and always pass/return the DTOs. Then whenever I needed to perform business logic, I would convert my DTO into a BO. The way I would do this is that my BO would have a have a constructor that takes a parameter that is the type of my interface (that defines the required fields/properties) that both my DTO and

Using DTOs and BOs

ε祈祈猫儿з 提交于 2019-12-05 14:22:49
One area of question for me about DTOs/BOs is about when to pass/return the DTOs and when to pass/return the BOs. My gut reaction tells me to always map NHibernate to the DTOs, not BOs, and always pass/return the DTOs. Then whenever I needed to perform business logic, I would convert my DTO into a

Symfony2.1 - The option “em” does not exist when using DataTransformer

痞子三分冷 提交于 2019-12-05 13:13:47
I am using this cookbook recipe to add a data transformer in Symfon 2.1, but I am getting the following error, The option "em" does not exist. Known options are: "attr", "block_name",.... Is this still a valid way to send the entity manager over to the form type? $taskForm = $this->createForm(new

Should i use builder pattern in DTO?

。_饼干妹妹 提交于 2019-12-04 11:44:36
问题 This might be a pretty subjetive question, but i would to know some more opinions. I've built a Rest API service with Spring MVC, and i implemented the DTO-Domain-Entity pattern. I want to know what do you think about implementing the Builder pattern in DTOs, something like public class UserResponseDTO extends AbstractResponseDTO { private String username; private Boolean enabled; public UserResponseDTO(String username, Boolean enabled) { this.username = username; this.enabled = enabled; }

libusb bulk transfer

时间秒杀一切 提交于 2019-12-03 13:39:05
问题 I am trying to implement user space usb driver using libusb1.0.9. I have lpc2148 blueboard(ARM7) with me..This board is loaded with opensource USB stack/firmware by Mr. Bertrik Sikken. Now my user space driver is trying read write with board. I am getting garbage data. I want to know about the flow of bulk tranfer. For any transfer/transaction is there kernel device driver involved?? and do we need usb gadget device driver also?? I am not able to understand that where the data gets copied.

How much business logic should Value objects contain?

会有一股神秘感。 提交于 2019-12-03 09:17:20
问题 One mentor I respect suggests that a simple bean is a waste of time - that value objects 'MUST' contain some business logic to be useful. Another says such code is difficult to maintain and that all business logic must be externalized. I realize this question is subjective. Asking anyway - want to know answers from more perspectives. 回答1: You should better call them Transfer Objects or Data transfer objects (DTO). Earlier this same j2ee pattern was called 'Value object' but they changed the

what is a good pattern for converting between hibernate entities and data transfer objects?

别来无恙 提交于 2019-12-03 08:31:22
问题 I have had similar questions and concerns as to how to convert between Hibernate entities and data transfer objects to be returned by a web service as are discussed in this question: Is using data transfer objects in ejb3 considered best practice One of the factors mentioned here is that if the domain model changes, a set of DTOs will protect consumers in the case of a web service. Even though it seems like it will add a substantial amount of code to my project, this reasoning seems sound. Is

Difference between Value Object pattern and Data Transfer pattern

荒凉一梦 提交于 2019-12-03 06:16:52
问题 In which scenario can I use those design patterns in n-tier architecture? 回答1: DTO is the object that you can use at the boundaries of the system. When you have a SOAP web service for example and you want to return response you would use DTO. It easier to deal with than actual XML that has to be returned over the wire. DTOs are often generated by tools, based on WSDL for example. DTO are often tailored to the needs of service consumer and can be affected by performance requirements. Value

工具导航Map

JSON相关