You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: