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

Methods renames #138

Open
sbcgua opened this issue Dec 24, 2022 · 2 comments
Open

Methods renames #138

sbcgua opened this issue Dec 24, 2022 · 2 comments

Comments

@sbcgua
Copy link
Owner

sbcgua commented Dec 24, 2022

Maybe:

  • rename create_empty to new (in fact mirrors 7.40 new operator behavior and "compatible" with it)
  • rename create_from to from
  • ... or even deprecate it in favor of clone/filter/map
  • ... however, there is a subtle case, when cloning can be done from a "mirror" of ajson, an "inetgrated ajson copy". E.g. abapgit_ajson or whatever other project which included ajson (maybe http_agent with ajson ...). I this case a passive method from can "guess" the source and map it to native ajson types. Not sure if it is really needed.
@mbtools
Copy link
Contributor

mbtools commented Dec 27, 2022

I prefer a "short verb" for method names as long as it's consistently used (i.e. not new for one class and create for another).

I don't mind adjusting existing code. Feel free to drop the old methods in a coming version 😄

@sbcgua
Copy link
Owner Author

sbcgua commented Dec 27, 2022

I added new in #117. So it is there. create_empty will live for some time, we use it in our code base ... and actually in AG probably. By the way zcl_ajson is also create public now. So: zcl_ajson->new( ... ), create object zcl_ajson ... and 7.40 new zcl_ajson( ... ) do the same now (which is good :)

So, yeah, prefer those options and probably it makes sense to adjust AG code too. FYI @larshp

create vs new - yeah ... there are some conflicts, I confess. But new is better. :)

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

No branches or pull requests

2 participants