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

Add duck typing variant #1

Open
wants to merge 1 commit into
base: master
from

Conversation

@guzart
Copy link
Owner

commented Jun 9, 2019

In this implementation, I added a title property as an example of how the Aggregate would receive and store data internally.

Go to project_management/issue.rb

Goals:

  • Have each state be a subclass of Issue as a way of expressing that the instances are still an Issue, but they are a different variation/state.
  • Make it simple to pass data around between the different states.
  • Don't expose the internal data structure

Cons:

  • Need to use a factory for initializing the aggregate root
  • The factory is also inherited by the subclasses. This makes it confusing when it return a New issue.
  • It's verbose to pass data property from one state to the next

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.