-
-
Notifications
You must be signed in to change notification settings - Fork 115
Comments
Added presenter mapper#16
Added presenter mapper #16Budry wants to merge 1 commit intonette:master from Budry:presenter-mapper
Conversation
dg
commented
Jun 23, 2014
I am not sure that own mapper is really needed. I agree that mapping can be enhanced for <module> and <presenter> placeholders, but in this case there is no need to use own mapper.
mishak87
commented
Jun 23, 2014
I for one would use such mapper. It really enables modularity across packages and default implementation can be reused as a fallback for custom implementation.
Now I can have multiple packages sharing same <module> by convention ie. namespace:
<?php $mapping = [ 'shop' => [ 'packageA/src/Shop/Presenters', 'packageB/src/Shop/Presenters', // ... ] ]
For now I have to prefix each package, because using multiple directories for same <module> is not possible. From my experience using paths with multiple modules is not really scalable across packages ie. <AModule>/<AdminModule>. Sharing <module> makes things simpler.
matej21
commented
Jun 23, 2014
👍
But I would remove the setMapping method in IPresenterMapper interface
Budry
commented
Jun 23, 2014
I think that use <module> and <presenter> placeholders would be good, but mapper could be usefully.
Mapper has no disadvantage, has only benefits in my opinion
Budry
commented
Jun 24, 2014
@matej21 you are rigth. I removed setMapping from interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline
enumag
commented
Jul 6, 2014
👍 for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for FQCN.
Majkl578
commented
Jul 6, 2014
👍 I like it.
It would be possible to create MapperChain, chaining multiple mappers for different modules of application (and even better, it would work greatly addons which use presenters). Maybe it would be the best to add it into Nette as well (it could be done in separate PR later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this method for BC purposes and just alias it to $this->presenterMapper->formatPresenterClass(...).
dg
commented
Jul 7, 2014
What is purpose of this PR? To add <module> and <presenter> placeholders? It will not help, because everybody will have to write own mapper. Implementations will be fragmented.
What is the advantage of "split" 2-methods IPresenterFactory into 2-methods IPresenterFactory plus 2-methods IPresenterMapper? Is there really such big need to create your own mappers?
c6ea262 to
7fc9a04
Compare
d4f8f8f to
b9ada7c
Compare
ab57645 to
3386bd1
Compare
b7c910a to
3f30cee
Compare
b9d4eb3 to
8ca92c7
Compare
e3a1ef7 to
b998e4d
Compare
88ef0bd to
b7df270
Compare
Discusion: http://forum.nette.org/en/19620-better-mapping-configuration#p135799
For easier use custom mapping implementation
with nette/bootstrap#8