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

Refactor code #235

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

SkybuckFlying
Copy link
Contributor

Consider applying this merge to your source base to reduce complexity and maintainable of UFRMWallet.pas:

Changes made:

Parts of UFRMWallet graphical user interface split into frames to reduce code complexity of UFRMWallet, frames stored in the frames subfolder.

Benefits:

Reduced complexity/code of UFRMWallet.
More functionality can be added to frames and keep code in their own unit to prevent UFRMWallet from becoming to complex.
This refactor may help to "abstractify the GUI' further in the future so fire monkey GUI can be build and re-use some of the abstractified code so that PascalCoin could run directly on mobile phones, tablets and possible other devices.
Frames can be individually re-designed, could make the re-design a bit easier/faster since Delphi has to manage less components, this could improve CPU performance while editing/re-designing frames/gui.
Frames could be re-used in other parts of the GUI
Frames could be moved around more easily to other sections or forms.
Inserted frames could be altered or deleted without affecting the main wallet code, this might make it possible to make alternative/smaller GUIs/version of pascalcoin, this has not yet been tested.

Drawbacks:

It might be a bit harder to understand the flow of the code between frames and the UFRMWallet. Code could be changed to make it easier to understand.
Components cannot be added to the inserted frames, adding components must be done on the frames themselfes.

The code should still be debugged, however I have high confident it will perform exactly the same, though testing it is always wise to see if maybe any call accidently calls an equivalent name however the chance of this happening is very small.

Further re-factoring improvements could be made to the frames in the future.

(Proper author and e-mail set)

@SkybuckFlying SkybuckFlying force-pushed the RefactorCode branch 2 times, most recently from 299ddb9 to 410073c Compare December 6, 2021 18:48
Risky initialization of
TNetData.NetData.OnBlackListUpdated := OnNetBlackListUpdated;
Not yet sure if this works, needs to be tested.
Not yet sure if frames can received windows messages.
Needs to be tested.
Calling property TNetData.NetData is unsafe.
Which calls TNetData.Create
Which calls procedure TECPrivateKey.GenerateRandomPrivateKey(EC_OpenSSL_NID : Word);
Which relies on UCrypto which is not yet initialized,
Which leads to access violation because UCrypto API routine pointers not loaded.

TNetData code moved back to procedure TFRMWallet.FinishedLoadingApp;
To be tested in TestGUIImprovements
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

Successfully merging this pull request may close these issues.

1 participant