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

Suggested init changes #65

Open
nsheff opened this issue Nov 27, 2024 · 0 comments · May be fixed by #71
Open

Suggested init changes #65

nsheff opened this issue Nov 27, 2024 · 0 comments · May be fixed by #71

Comments

@nsheff
Copy link
Member

nsheff commented Nov 27, 2024

  1. Make it so we don't have to init everything.

Right now, if something in the constructor doesn't init (like the b2bsi object, say), then the whole thing will crash.
Instead, the object should fail gracefully; it should init all the things it can init, and then just not provide the functions that it cannot do.

  1. Use side effects for init functions

BedBaseConfig._init* functions are returning the thing they init. Instead, as methods, they should just init the thing as a side effect.
The reason is that then a user can more easily call

A user may want to init something after the object is created. Right now, the _init functions are private, and they don't actually init the thing they just return the value. So a user can't really init things on their own.

Instead, these should use side effects to attach the initialized objects, and allows users to not initialize everything at the constructor step, instead allowing the user more modularity.

This would simplify the code and be more flexible, without changing the default use mode.

nsheff added a commit that referenced this issue Nov 27, 2024
@khoroshevskyi khoroshevskyi linked a pull request Dec 22, 2024 that will close this issue
2 tasks
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 a pull request may close this issue.

1 participant