Fallback form creation to default form type if given purpose has no associated form type #15

Merged
merged 1 commit into from Nov 8, 2012

Projects

None yet

3 participants

@gquemener
Contributor

No description provided.

Contributor
everzet commented Nov 8, 2012

Perfect!

@everzet everzet merged commit a8e5c96 into master Nov 8, 2012

1 check passed

default The Travis build passed
Details
Contributor

I've thought again about the form type creator resolving rules and currently it follows this one:

  1. Does PurposeEntityType exist? use it.
  2. Does EntityType exist? use it.
  3. Does Entity have a parent? Does ParentEntityType exist? use it.
  4. Use none (meaning let the default creator handle this entity)

I think it'll be better to follow this one:

  1. Does PurposeEntityType exist? use it.
  2. Does Entity have a parent? Does PurposeParentEntityType exist? use it.
  3. Does EntityType exist? use it.
  4. Does Entity have a parent? Does ParentEntityType exist? use it.
  5. Use none.
Contributor
everzet commented Nov 9, 2012

@gquemener I think you should remove parent entities support altogether from rule or convention becomes too complex. Convention should be easy and simple to describe. And your "use parent type if no current type available" is easily achievable by creating simply empty type class, that extends parent.

Contributor
everzet commented Nov 9, 2012

We need to preserve balance between complexity of manual implementation and complexity of convention rules.

Contributor
everzet commented Nov 9, 2012

So, rule becomes simple:

  1. Does PurposeEntityType exist? use it.
  2. Does EntityType exist? use it.
  3. Pass resolving task to next creator
Member

see #16

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