Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different business logic structure names (DAO) using same DTO #21

Open
guyguy333 opened this issue Dec 6, 2020 · 1 comment
Open

Different business logic structure names (DAO) using same DTO #21

guyguy333 opened this issue Dec 6, 2020 · 1 comment

Comments

@guyguy333
Copy link

guyguy333 commented Dec 6, 2020

Hello,

I just found your transformer and it looks promising. However, it doesn't suit well our use-case. In our case, structure name in business logic package is not the same everywhere. I mean, each microservice can use different DAO name while using the same DTO. I can't find how to manage that.
I think metadata doing bridge between DTO and DAO should be in DAO side, not DTO.

Do you have a solution ? What's your point of view ?

Thanks

@guyguy333 guyguy333 changed the title Different structure names (DAO) using same DTO Different business logic structure names (DAO) using same DTO Dec 6, 2020
@ekhabarov
Copy link
Contributor

Hi @guyguy333,

Thanks for asking, it's a good question, where metadata should be located. When this plugin was written there was no such use case 1:N mapping and this plugin supports 1:1 one only. All transformation functions based on structure type, so if you have one protobuf message and many different structure types in business logic, this plugin doesn't help you much, unless you define as many protobuf messages as business logic has ones.

From the other side, solution can be defined as a list of structure type pairs, where source structure will be the same for each pair and as a result you'll get two functions for each pair. There is another tool https://github.com/powerflyco/sts which has same idea but it works with structure types directly, where one of the structure could be protubuf message, also it supports go generate... command and pairs can be defined on any side.

Hmm, just thinking, parser for this plugin could be replaces with sts one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants