Hi,

On 23/08/2018 17:16, Mathieu Lirzin wrote:
Hello Nicolas,

[...]
example :
<extend-form location='component://party/widget/PartyForms.xm'
name='ViewPartyGroup'>
<field name="partyId" >
<hyperlink description="Goto my plugin with : ${parameters.partyId}"
target="/myplugin/control/viewprofile" target-type="inter-app"
target-window="blank_">
<parameter param-name="partyId"/>
</hyperlink>
</field>
</extend-form>
I find the “extend” term confusing in that case, because AIUI extending
is more about defining a new thing by inheriting from what is extended.
If I understand the semantics of your example correctly, it is more
about monkey patching [1]
‘component://party/widget/PartyForms.xml#ViewPartyGroup' than to create
an extended of version of it.  Is that a correct interpretation?
Not exactly how I imagine it. It's not the plugin who change the model but more the ModelReader who would come and take modifications wanted by plugins. I used 'extend model' term simply we already use a similar system with <extend-entity> element to surcharge an entity from an other component. We can naming how we want, the most important part for me is record all modifications wanted by plugins at the start without apply them.
If my interpretation is correct, it is not clear what should happen when
multiple plugings modify/patch the same form?
As it would be the ModelReader who load wanted modifications, if one (or more) failed we can analyze why we can't apply it, generate information in log for developer and protect the model creation to ensure rendering all screens.

If a conflict appear between two plugins we can use different algorithm:
* FIWLC : First In Win Last Cry
* LIWFC : Last In Win First Cry
* NCNW : No Cooperation No Win
With this, we would have a plugin that can surcharge a screen, a form,
a menu without changingnothing in the framework, identify clearly what
change has been made and a failure support when the extend can't be
applied.

Currently I didn't found a solution to surcharge ftl.

If you feel that it's a good way to explore, I will start a new thread.
I guess I have started the thread :-)
Indeed !
Cheers,
Nicolas

[1] https://en.wikipedia.org/wiki/Monkey_patch


Reply via email to