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

Java chaincode review for enhanced code-base #22

Open
9 of 12 tasks
aklenik opened this issue Jul 26, 2023 · 4 comments
Open
9 of 12 tasks

Java chaincode review for enhanced code-base #22

aklenik opened this issue Jul 26, 2023 · 4 comments
Assignees

Comments

@aklenik
Copy link
Contributor

aklenik commented Jul 26, 2023

Legend:
🔴: High priority.
🟡: Medium priority.
🟢: Low priority.
🔵: Discussion.

General

Delivery

New Order

Order Status

Payment

LGTM

Stock Level

Other components

TBD

@bzp99
Copy link
Collaborator

bzp99 commented Jul 30, 2023

The following and similar nested statements should be split into multiple statements using variable assignments, so it's easier to read (and would facilitate step-by-step debugging if we could set that up 😄).

I would consider this a very low-priority issue, but I slightly disagree. This is subjective, but I think serialize(doSomething(deserialize(params))) is still within the realms of readability. But maybe I just like Lisp too much 😆.

Anyway, my main point is that from a debugging perspective, I think decent debuggers (which are available for Java) let you step into statements even if they are inlined like this. So this is a non-issue. Which makes all this a matter of preference, so if others prefer the expanded form, I don’t mind. Just wanted to add my 2c.

[other points]

I agree with everything else, thanks for the insights! The mentioned method names are indeed misleading and most importantly, I am well aware of the poor implementation of Registry#select. This is what we could afford in the available time, but it’s a clear point of improvement with surely significant performance gain effects.

@bzp99
Copy link
Collaborator

bzp99 commented Jul 30, 2023

A sidenote regarding misleading method names: the javadoc comments above some of the methods indicate that there are side effects, but there are some methods that are missing these comments. Furthermore, just because the comments warn of the side effects, this is still just bad practice.

@bzp99
Copy link
Collaborator

bzp99 commented Apr 9, 2024

Fixed some of the issues in #23 , marking them here…

@bzp99
Copy link
Collaborator

bzp99 commented Apr 9, 2024

We still have the issue of the select implementation being inefficient. IIRC it has been implemented this way because of some OpenJML problems – we just went with this ‘brute-force’ approach for now. I will come back to it later, for now I did not attempt to play with fire again :)

Regarding propagating the minimum constraint back to the JS implementation: I did not do this yet because first I would like to find out why we are checking the last 5 items in the Java version and not the last 20. The spec says 20. I think this also may have been a shortcut to deal with some OpenJML problems or just some simplification for testing, but I am not sure.

@bzp99 bzp99 closed this as completed in c5d9dfa May 14, 2024
@bzp99 bzp99 reopened this May 14, 2024
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