-
Notifications
You must be signed in to change notification settings - Fork 303
package of TOs #67
Comments
I will also update cobigen templates accordingly. |
I will also change the component Interfaces and Implementations to be compatible with what CobiGen is producing. |
…ments and one of them is TOs that do not belong to logic layer
Putting the TO (ETOs/DTOs) in common/api looks wrong to me. For me they are part of the logic layer api for the component. They should go to logic/api. |
Surely we can discuss this but actually assigning something to a layer is implicitly limiting the usage and access. We are technically using these objects in the client. If we would have a GWT client, we would violate our own architecture rules if we put the objects in logic. According to simplicity (KISS) we avoided extra service transfer objects. For our sample application we could still move the TOs back to logic but for me they are "common" within the component just like datatypes are. |
After discussion with Jörg we decided to open a ticket for that (see oasp/oasp4j-sample#39). |
Sorry guyz but sonarqube is now complaining for good reason that we are violating our own architectural rules: |
The same applies for all SearchCriteria TOs that are used by DAOs. |
So my argument was exactly that putting TOs to common is wrong, because we don't want them in the persistence layer. If it's permissive to use TOs in persistence I agree they should go to common. |
@maihacke did you study my prior comment? SearchCriteriaTOs are exactly for search criteria used in dynamic queries that belong into DAOs in dataaccess. Feel free to argue that ETOs should not go to common if you like. This might be a pointless discussion but for SearchCriteriaTO this is IMHO just obvious and no discussion needed. |
@maihacke I saw it comming from the start. If we define an architecture and rules we should strictly follow it. Have a look here (SonarQube now reveals our mistakes): So lets change this as I proposed. |
I think there should be SearchCriteria objects in the persistence layer and a mapping from the TOs to the persistence objects in the Uc implementation. This has also the benefit that, if we replace SearchCriteriaTO with Spring-Datas-Implementation, a dependency to spring-data at theservice-layer would occur. |
I have already moved the base classes
AbstractEto
andAbstractCto
togeneral.common.api.to
. From a discussion we will also move the concrete Eto and Cto classes tocomponent.common.api.to
.Reason: The Transferobjects of a business component are not specific or explicitly limited or dedicated to the logic layer. There was also a discussion that they would belong to the service layer (out of scope for this ticket). Putting them to common makes sense and allows to use them also in the client layer (e.g. if once somebody wants to write a GWT client based on OASP). If assigned to the logic layer the client layer would not be allowed to use the TOs according to the architecture model.
To document this change, I create this ticket.
The text was updated successfully, but these errors were encountered: