<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 11 Oct 2010, at 13:44, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><blockquote type="cite"><div><br>PS: There is no JIRA for this. &nbsp;If we like this approach and it works, I suggest we create a JIRA and implement it for 4.2. &nbsp;The impl should be simple once we resolve the outstanding bits.<br></div></blockquote>there is one actually:&nbsp;<a href="https://jira.jboss.org/browse/ISPN-256">https://jira.jboss.org/browse/ISPN-256</a></div><div>I'll attache the patches to it.</div><div><a href="https://jira.jboss.org/browse/ISPN-256"></a>Just to conclude, I've POC both approaches GenericCommand and ExtendingCommand, here are my thoughts on it:</div><div>- extending visitor</div><div>PROS: &nbsp;ExtendingCommand is a better OO API, more strongly typed</div><div>CONS: it is harder for the user to understand; integrating custom serialization might be difficult(impossible at the time), also it will have to manage command uniques.&nbsp;</div></span></blockquote><div><br></div><div>Why is this hard for developers to understand? &nbsp;Remember, these aren't *application* developers, but people *extending* Infinispan. &nbsp;They already ought to have an in-depth knowledge of Infinispan.</div><div><br></div><div>What do you mean by "command uniques"?</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>- GenericCommand</div><div>CONS:&nbsp;</div><div>- less OO API</div><div>- would require a "convention" for not "overusing" it. Overuse would be in client code though, not in ours</div></span></blockquote><div><br></div><div>Client code may well be our code. &nbsp;E.g., more modules that we ship. &nbsp;-1 to a weakly typed API like this. &nbsp;Conventions cannot be enforced, and IMO if something can be abused, then it will be abused. &nbsp;:)</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>PROS:</div><div>- easier for the user to understand and use</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>-&nbsp;no need for extra classes needed</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>- no&nbsp;understanding of how the interceptor chain internals work needed (for writing acceptVisitor).&nbsp;</div></span></blockquote><div><br></div><div>Why would someone write a visitable command and not care about an interceptor that visits it? &nbsp;Surely you would only write a visitable command if you *want* to visit it with an interceptor.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>- no understanding of&nbsp;how serialization works &nbsp;is needed. Nor command uniques.</div></span></blockquote><div><br></div><div>? &nbsp;What's so hard about this? &nbsp;"implements Externabilzable" is the easy way, @Marshallable() a slightly more roundabout way for greater efficiency in marshalling.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>- easy streight-forward solutions</div><div><br></div><div>I would go for GenericCommand, but Extending approach works for me as well.</div></span></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>