<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 31 Mar 2009, at 12:02, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Manik Surtani wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 31 Mar 2009, at 11:16, Mircea Markus wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Hi,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Some thought on ReplicateCommand.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">It is also used to replicate a single command, which is inefficient, as 2 objects are unnecessarily created: the ReplicateCommand itself and an array holding only one object.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Why not replicated the aggregated command directly?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The actual command is replicated directly. &nbsp;See ReplicateCommand.getParameters(). &nbsp;There is just an extra int in the byte stream containing the number of commands contained.<br></blockquote>There still are two built objects being built, ReplicateCommand and the aggregated ReplicableCommand[], that's my concern.<br>Re:getParameters, I see that there is an array built in that command, which contains the param list. what about creating an array pool, and pass them to the command, i.e. the signature would be: getParameters(Object[] params)?</div></blockquote><div><br></div><div>Well, this is unnecessary if we go with different impls as suggested below.</div><br><blockquote type="cite"><div><br><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Another thing about the name: even though it is correct, it sounds very much like ReplicableCommand. I suggest renaming to CompositeCommand, or ContainerCommand.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">wdyt?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Agreed about the name. &nbsp;Don't like CompositeCommand or ContainerCommand though, they both suggest a command that holds other commands. &nbsp;That is not this command's primary purpose. &nbsp;It's primary purpose is to "transport" a command across a network and execute the command on a remote cache.<br></blockquote>Yep, see your point re: composite.<br><blockquote type="cite"> <br></blockquote><blockquote type="cite">So, the interface it implements is more appropriately named (CacheRPCCommand). &nbsp;Perhaps there should be 2 separate implementations, SingleRPCCommand, MultipleRPCCommand?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Manik Surtani<br></blockquote><blockquote type="cite">Lead, JBoss Cache<br></blockquote><blockquote type="cite"><a href="http://www.jbosscache.org">http://www.jbosscache.org</a><br></blockquote><blockquote type="cite">manik@jboss.org &lt;<a href="mailto:manik@jboss.org">mailto:manik@jboss.org</a>><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br></div></blockquote></div><br><div apple-content-edited="true"> <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-infinispantal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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-infinispantal-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>Lead, JBoss Cache</div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a><br><a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>