Hi Andreas,<br>&nbsp;there are other guys (Claudio and Nicolas, they just sent and email about traits browser) that are doing something quite similar to what you suggest.<br>&nbsp;They will re-implement the Collection hierarchy using traits and compare that model to the current Collection hierarchy to see if they got a better model/implementation using traits or not. 
<br>&nbsp;I think that doing exactly what you suggest in this case is not easy because there is a well accepted implementation of the Collection hierarchy... we should look for another problem to apply your idea without &quot;noise&quot;... I keep that in mind and offer your idea to other students.
<br><br>&nbsp;Thanks!<br>&nbsp;Hernan<br><br><br><div><span class="gmail_quote">On 9/6/07, <b class="gmail_sendername">Andreas Raab</b> &lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How about, in addition to the traits refactorings, also looking at<br>alternative methods to achieve the same goals and compare and contrast<br>them? I find it unfortunate that so far no work has been done that<br>actually compares refactorings with traits to those done without and see
<br>what the differences and similarities are.<br><br>Cheers,<br>&nbsp;&nbsp; - Andreas<br><br>mrgonza78 wrote:<br>&gt; In my particular case, what I&#39;m doing is a master thesis about trait aware<br>&gt; refactorings. I&#39;m not looking for the best usages of traits. My focus is on
<br>&gt; the traits aware refactorings I&#39;m working on.<br>&gt; That&#39;s on one hand, on the other hand I agree that just removing code<br>&gt; duplicated across hierarchies is not the best way of selling traits.<br>
&gt; I posted the message because I don&#39;t only want to show the result of the<br>&gt; refactorings per se, but I also look for a good case in which traits fits<br>&gt; well (if the effort of the refactoring doesn&#39;t get me out of my thesis).
<br>&gt; I think what I&#39;ll end doing is half and a half: I&#39;ll apply refactorings just<br>&gt; to remove duplicated code or just for the sake of the refactorings (so I can<br>&gt; collect result or conclusions from them) and also, I&#39;ll aply refactorings
<br>&gt; for the sake of both the refactorings and traits (so I can collect result or<br>&gt; conclusions from the refactorings and at the same time show how good traits<br>&gt; are).<br>&gt; May be I was too ambitious when I named Seaside, Magritte and Morph. Looking
<br>&gt; for good traits and refactoring in those framework may take me several<br>&gt; months and may be subject of it&#39;s own thesis (if any).<br>&gt; Thanks for the mind set and hints, I found them very useful.<br>&gt; Alejandro
<br>&gt;<br>&gt;<br>&gt; Jason Johnson-5 wrote:<br>&gt;&gt; Keep in mind that Traits are not at the same level as inheritance, for<br>&gt;&gt; instance.&nbsp;&nbsp;I wouldn&#39;t think of traits as a means of eliminating code<br>&gt;&gt; duplication, even if that is how they are often sold.&nbsp;&nbsp;I would try to
<br>&gt;&gt; keep the mind set that Traits are.... traits.&nbsp;&nbsp;That is &quot;am I working<br>&gt;&gt; here with a new entity? (create a class) An entity that has various<br>&gt;&gt; specializations? (create subclasses) Or am I working with a trait that
<br>&gt;&gt; many unrelated classes have? (trait)&quot;.<br>&gt;&gt;<br>&gt;&gt; If you use this mindset then I think you can find elegant places for<br>&gt;&gt; traits when they are needed.&nbsp;&nbsp;If we go around looking for duplicated
<br>&gt;&gt; code and stick a trait in there we will end up with a mess.&nbsp;&nbsp;There are<br>&gt;&gt; many ways of eliminating duplicate code, you don&#39;t need traits for<br>&gt;&gt; this.<br>&gt;&gt;<br>&gt;&gt; Having said that, I would like to see what you&#39;ve done with Magnitude
<br>&gt;&gt; as that is a very obvious trait in my opinion.&nbsp;&nbsp;To find a trait look<br>&gt;&gt; for classes that seem to be inherited to the wrong place, purely to<br>&gt;&gt; gain some interface or something.&nbsp;&nbsp;A trait could be hiding there, or
<br>&gt;&gt; it could simply be a case that needs normal traditional refactoring.<br>&gt;&gt;<br>&gt;&gt; The other thing I would personally keep in mind is that traits<br>&gt;&gt; probably work best when kept small.&nbsp;&nbsp;For example, in Magnitude you
<br>&gt;&gt; basically just have equality and comparison.&nbsp;&nbsp;I would even break that<br>&gt;&gt; up to an equality trait (for things which can be equal) and a<br>&gt;&gt; comparison trait (for things which can be compared).&nbsp;&nbsp;If you get a
<br>&gt;&gt; trait that is as big as a class, then I would consider that a strong<br>&gt;&gt; code smell.<br>&gt;&gt;<br>&gt;&gt; On 9/6/07, Alejandro Gonzalez &lt;<a href="mailto:mrgonza78@gmail.com">mrgonza78@gmail.com</a>
&gt; wrote:<br>&gt;&gt;&gt; Hi,<br>&gt;&gt;&gt;&nbsp;&nbsp; I&#39;m working in trait aware refactorings, and I reached a point in which<br>&gt;&gt;&gt; I<br>&gt;&gt;&gt; have to use them so as to give them a try in real cases and see how
<br>&gt;&gt;&gt; suitable<br>&gt;&gt;&gt; they are or see what other features should be nice to have.<br>&gt;&gt;&gt;&nbsp;&nbsp; I&#39;m wandering through the image looking for good candidates to apply<br>&gt;&gt;&gt; traits. I started (and I already finished)&nbsp;&nbsp;with Magnitude and a few
<br>&gt;&gt;&gt; particular classes. Now it&#39;s time for another refactoring a little more<br>&gt;&gt;&gt; ambitious, but not many ideas have came out of my mind so far :(<br>&gt;&gt;&gt;&nbsp;&nbsp; Stream and Collection (I know the latter was already refactored) are
<br>&gt;&gt;&gt; good<br>&gt;&gt;&gt; candidates, I&#39;ll start looking at them, but I was wondering if there<br>&gt;&gt;&gt; wasn&#39;t<br>&gt;&gt;&gt; other projects/frameworks like Seaside, Magritte, Morph? or something
<br>&gt;&gt;&gt; else,<br>&gt;&gt;&gt; that could benefit from traits.<br>&gt;&gt;&gt;&nbsp;&nbsp; I&#39;m not looking to implement something with traits from scratch, I just<br>&gt;&gt;&gt; want to take a set of classes, methods (or traits, why not) and
<br>&gt;&gt;&gt; restructure<br>&gt;&gt;&gt; code by applying refactorings instead of doing it manually.<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;Anyone having an idea, please let me know it. Just name a class and a<br>&gt;&gt;&gt; couple of methods you know are spread across several classes and where
<br>&gt;&gt;&gt; you<br>&gt;&gt;&gt; think traits would help, and I&#39;ll figure out what and how to refactor.<br>&gt;&gt;&gt;&nbsp;&nbsp; Thanks in advance<br>&gt;&gt;&gt;&nbsp;&nbsp; Alejandro<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;
<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br><br></blockquote></div><br>