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

[RFC] Redesign #55

Open
xepozz opened this issue Oct 5, 2022 · 4 comments
Open

[RFC] Redesign #55

xepozz opened this issue Oct 5, 2022 · 4 comments

Comments

@xepozz
Copy link
Member

xepozz commented Oct 5, 2022

Architecture design now looks like:

  • All logic in one class:
    • "Loading" parameters into Generators made as with forms
    • Validation placed inside Generators
    • Preview and action placed inside Generators
  • Each Generator extends BaseGenerator that contains a lot of common logic
  • Separated templates files
  • Console and web api supported quite good

I want to suggest to refactor it a bit:

  • Move out data classes from Generators
  • Move validation rules to that data classes
  • Use composition instead of inheritance in Generators
  • Remove preview action and replace it with in-memory storage
  • Use command + handler pattern for Generators and their data classes. So we will have stateless handler and stateful command (data class)
  • Use the validator's feature dumping validation rules for exposing Generators parameters for API and Console (if it's possible and cheap)

Whole concept is similar to validator's.

@samdark
Copy link
Member

samdark commented Oct 6, 2022

Does it improve one of the following:

  1. User experience?
  2. Experience when adding your own generators/templates?
  3. Maintainer experience?

@xepozz
Copy link
Member Author

xepozz commented Oct 7, 2022

That makes code simpler and enhances reading and maintaining.

@samdark
Copy link
Member

samdark commented Oct 9, 2022

How about user experience and experience when adding generators/templates?

@xepozz
Copy link
Member Author

xepozz commented Oct 16, 2022

#58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants