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

Where should it be possible to enable/disable a floret in code? #85

Open
pstued opened this issue Jan 6, 2019 · 0 comments
Open

Where should it be possible to enable/disable a floret in code? #85

pstued opened this issue Jan 6, 2019 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@pstued
Copy link
Member

pstued commented Jan 6, 2019

Current Scenario

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.
@pstued pstued added the question Further information is requested label Jan 6, 2019
@brototyp brototyp changed the title Move enabled/disabled out of a Floret? Where should it be possible to enable/disable a floret in code? Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants