-
a book for those who already know something about the subject and want to be reminded of how all the jigsaw pieces fit together. And it is a priceless window into the mind of one of the major players in present-day cosmology.
-
Kindle 2 解析
-
信使杂志又复刊了呀。才知道。
-
Inheritance is well-known and accepted as a mechanism for reuse in object-oriented languages.
Unfortunately, due to the coarse granularity of inheritance, it may be difficult to decompose an
application into an optimal class hierarchy that maximizes software reuse. Existing schemes based
on single inheritance, multiple inheritance, or mixins, all pose numerous problems for reuse. To
overcome these problems we propose traits, pure units of reuse consisting only of methods. We
develop a formal model of traits that establishes how traits can be composed, either to form other
traits, or to form classes. We also outline an experimental validation in which we apply traits to
refactor a non-trivial application into composable units. -
Traits are a programming language technology that promote the reuse of methods between unrelated classes. This paper reports on a refactoring of the Smalltalk collections classes using traits. The original collection classes contained much duplication of code; traits let us remove all of it. We also found places where the protocols of the collections lacked uniformity; traits allowed us to correct these non-uniformities without code duplication.Traits also make it possible to reuse fragments of collection code outside of the existing hierarchy; for example, they make it easy to convert other collection-like things into true collections. Our refactoring reduced the number of methods in the collection classes by approximately 10 per cent. More importantly, understandability maintainability and reusability of the code were significantly improved.
links for 2009-03-05
This entry was posted on 06/03/2009 (Friday) at 1:02 am and is filed under 網路書簽. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Printed from: http://www.mingli-yuan.info/archives/337 .
© Mingli Yuan 2010.
© Mingli Yuan 2010.