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

Feature Request: Would be great to be able to enumerate the properties that are different! #50

Open
Simonl9l opened this issue Mar 14, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Simonl9l
Copy link

Would be great to have a wrapper class such that one can have a Comparer collect the difference between say two record's or other supported type. This would also walk the nested collection and say use a ., [x] or => notation for the hierarchy, array/set elements or maps.

A Use Case: CDC you have the before and after image from your database of choice and need detect what changes happen between them, so some conditional biz logic can be applied based upon that.

That this generator avoids reflection means it will also work with AoT compilation.

@diegofrata diegofrata changed the title Feature Request: Would be great to be able to enumerate the priorities that are different! Feature Request: Would be great to be able to enumerate the properties that are different! Apr 23, 2023
@diegofrata diegofrata added the enhancement New feature or request label Apr 23, 2023
@diegofrata
Copy link
Owner

I haven't got much time recently to invest in new features. I will keep this here in case someone has a view on how this would be implemented/used.

@Nickztar
Copy link

I'd love to attempt this. Would be a very nice feature, would help when debugging aswell 👍🏼

Will get back when I have a working example/PR.

@diegofrata diegofrata added the help wanted Extra attention is needed label Nov 12, 2023
@hayer
Copy link
Contributor

hayer commented Feb 6, 2024

How do you show the difference between string? Do a Myers diff?
What about byte[] or string[]? And is char[] treated as a string?
Then you have DateOnly, what is the result there? And the list goes on.

I love the idea but two things come to my mind;

  • This is very opinionated and quickly gets tied to business rules and logic.
  • It can quickly grow complex it probably deserves its own package, Generator.Diffs

@diegofrata
Copy link
Owner

diegofrata commented Feb 7, 2024

Perhaps it is the wording, but my understanding is that this is a feature request to enumerate inequalities but not necessarily create diffs. I think that would be a reasonable feature to have, although I totally agree diffs are out of scope for this library.

@Simonl9l
Copy link
Author

Simonl9l commented Feb 7, 2024

Yes inequality is sufficient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants