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
The Floret protocol defines a var enabled: BOOL { get set }.
Pro
The xyzFloret.enabled = true is a very simple and clear way to enable / disable a floret
Con
Every implementation of Floret has to define this property itself.
The initial value of enabled is undefined. Every Floret can define that for itself and thus it is going to be inconsistent.
The Cauli instance itself isn't informed about changes. If we somewhen want to act upon that a floret was enabled / disabled, we would have to observe the enabled property.
Alternate Scenario
A Cauli instance is initialized with all florets, which are disabled. To enable a floret a user can use the CauliViewController and a developer can use a cauli.enable(floret) function.
Pro
Consistent state of every floret.
Con
Florets can currently be either structs or objects. So comparing them by identity is not given.
The text was updated successfully, but these errors were encountered:
Current Scenario
The Floret protocol defines a
var enabled: BOOL { get set }
.Pro
xyzFloret.enabled = true
is a very simple and clear way to enable / disable a floretCon
enabled
is undefined. Every Floret can define that for itself and thus it is going to be inconsistent.enabled
property.Alternate Scenario
A
Cauli
instance is initialized with all florets, which are disabled. To enable a floret a user can use the CauliViewController and a developer can use acauli.enable(floret)
function.Pro
Con
The text was updated successfully, but these errors were encountered: