Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

Putting Metaclasses to Work

5.0 out of 5 stars 4 customer reviews
ISBN-13: 978-0201433050
ISBN-10: 0201433052
Why is ISBN important?
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
Have one to sell? Sell on Amazon
More Buying Choices
7 New from $84.91 18 Used from $31.66
Free Two-Day Shipping for College Students with Prime Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student

ITPro.TV Video Training
Take advantage of IT courses online anywhere, anytime with ITPro.TV. Learn more.
click to open popover

Editorial Reviews

From the Inside Flap

In object-oriented programming, objects are created as instances of classes. This book deals with the kind of object model in which classes are themselves objects (that is, classes are created as instances of other classes). We have discovered the key to designing such a model so as to improve markedly the levels of composability and reusability attainable in object-oriented programming. Our goal in writing this book is to convey our discovery to others interested in object-oriented programming.

If one thinks of objects as cookies, then classes are analogous to cookie cutters. Cookie cutters are templates that are used to make and determine the properties of cookies; classes make and determine the properties of objects. But how are cookie cutters themselves made? Let us say that they are pressed from sheet metal using a cookie cutter press (a piece of heavy machinery). So, if a cookie cutter press is used to make cookie cutters, what is used to make classes? The answer is a metaclass. Although a cookie cutter press does not directly make cookies (because it makes cookie cutters), it does determine properties of cookies. In a very similar way, a metaclass can determine the properties of objects, because it builds a class that makes objects. Our solution for greater reusability is based on the use of metaclasses to isolate and implement object properties.

Metaclasses alone are not enough to attain the improved levels of composability and reusability. This book introduces a new kind of object model called a monotonic reflective class-based model. In this new model, inheritance extends beyond instance variables and methods into a new dimension in which the relationship between a class and its metaclass is also inherited. This extension, called inheritance of metaclass constraints, is our key discovery. In the resulting technology, not only can metaclasses isolate and implement individual properties, but the composition of the metaclasses isolates and implements the composite property. That is, if one metaclass implements property P while another implements property Q, the composite metaclass implements the property P and Q. This degree of composability does not happen by accident; it is engineered by the proper design of metaclasses and other primitive capabilities within our technology.

In the course of developing the abovementioned ideas, this book explains concepts that are generally useful to and appreciated by anyone interested in object-oriented programming. This book develops object technology from first principles. In doing so, it motivates and demystifies metaclasses, shows how to construct them and compose them, and presents examples of their use. By reading this book, you will learn not only our technology but also the general principles of reflection in object technology.

This book returns to the source of power of object-oriented programming--the synergy of knowledge representation and programming--to yield a major improvement. Consider the following linguistic interpretation of the evolution of computer programming. In the 1950s and 1960s, programming was about commanding the computer--verbs. In the 1970s, this approach proved deficient. A new paradigm arose in which the specification of abstract data types and then classes--nouns--became foremost for the programmer. This paradigm, object-oriented programming, has evolved throughout the 1980s and 1990s. Although powerful and useful, object-oriented programming has proved deficient in isolating properties of objects--adjectives--so that the code that implements a property can be reused. Our technology has an abstraction for adjectives (metaclasses) to complement the nouns (classes) and verbs (methods) of today's object technology. Furthermore, as we will show, composition of metaclasses is as easy as putting a sequence of adjectives in front of a noun when we speak. Organization of This Book Chapter 1 motivates our work with a compelling story for both individual programmers and the organizations for which they work. Chapter 2 introduces our theory of reflective class-based object-oriented models. The theory is built up from first principles (for example, every object has a class, all classes are objects, and so on). Chapter 3 introduces a new semantic concept for object models: inheritance of metaclass constraints. This concept implies a new invariant on the class structure of an object model with metaclasses. Inheritance of metaclass constraints is fundamental to ensuring proper class composition. Chapters 4 and 5 together explain how the object model becomes object-oriented programming by binding the structures developed in Chapter 2 to programming language constructs (in particular, we use C++). This book is about a new way of looking at object-oriented programming in general; we purposefully do not introduce a new programming language syntax. Chapter 6 presents the basic metaobject protocol for our object model. The metaobject protocol is used to program new metaclasses that isolate reusable properties. Chapter 7 uses the metaobject protocol to create a new abstraction, the cooperative metaclass, which is used to attain composability of metaclasses. The combination of Chapters 6 and 7 is the entire metaobject protocol; the separation is for pedagogical purposes. Chapters 8, 9, and 10 contain useful examples of metaclasses that can be built with our metaobject protocol and the cooperative metaclass. These are examples of commonly needed object properties that cannot be isolated and reused in the current programming languages. Chapter 11 presents and solves the problem of release-to-release binary compatibility. Subclassing between separately compiled units has been troublesome in object-oriented programming. We formalize and solve the problem, and state the implications of the solution for object models with metaclasses. Basis for Claims

This book presents new techniques in object-oriented programming, and you have the right to ask our basis for claiming that these techniques are effective. We developed and used these techniques over a four-year period in the evolution of IBMis SOMobjects Toolkit. Most of the important metaclasses described in this book are based on metaclasses implemented in IBMis SOMobjects Toolkit 3.0, although not all of them have publicly available interfaces (those without public interfaces are used to program other parts of the toolkit). All of these metaclasses have been used by the authors or other SOM programmers to write real programs.

The metaclasses of IBMis SOMobjects Toolkit 3.0 are written using the toolkitis metaobject protocol. To make this book as readable as possible, we have simplified that protocol. In addition, we have taken the opportunity in writing this book to improve the toolkitis metaobject protocol. Because of these two factors, our metaobject protocol (the one in this book) is SOM-like, but is not SOM.

Because we have deviated from IBMis SOMobjects Toolkit 3.0 in this book, we have provided a simulation of the object model, our metaobject protocol, and an implementation of all metaclasses in this book that runs on the object model simulation. This is programmed in Java (because of its portability) and can be downloaded from the following URL awl/cseng/titles/0-201-43305-2. Consult the ireadmei file for further information about the simulation. Audience

This book is intended for programmers, researchers in object-oriented programming, and students in computer science. It is written at the level of senior undergraduates studying computer science. There are two prerequisites for reading this book:

An aquaintance of the basic ideas of object-oriented programming, because we do not go into detail as to why encapsulation, polymorphism, and inheritance are important A minimal understanding of discrete mathematics, which can be obtained from any number of books (in particular, 53 is an excellent choice) Acknowledgments

Throughout the six years of work that led to this book, we have benefited from discussions with and comments from many friends and colleagues. We thank Liane Acker, Govind Balakrishnan, Arindam Banerji, Michael Cheng, Ravi Condamoor, Mike Conner, George Copeland, Diane Copenhaver, Brad Cox, Nissim Francez, Kevin Greene, Ted Goldstein, Mike Heytens, Duane Hughes, Shmuel Katz, Gregor Kiczales, Donovan Kolbly, Hillel Kolodner, Vinoj Kumar, John Lamping, Rene Llames, Hari Madduri, Andy Martin, Simon Nash, Harold Ossher, Andy Palay, Jim Platt, Tom Pennello, Larry Raper, Cliff Reeves, Charlie Richter, Brian Ritter, Frederick Rivard, Kim Rochat, Jerry Ronga, Roger Sessions, Erin Shepler, Marc Smith, Robert Stroud, Brian Watt, and Cun Xiao for their aid in achieving our goal. Special thanks go to Derek Beatty, David Boles, Michael Cheng, Nathaniel Forman, John Lamping, Doug Lea, Charlie Richter, Leick Robinson, Brett Schuchert, Kent Spaulding, and Gerhart Werner for their comments on the draft of this book. Special acknowledgment must go to the designers and implementors of the original version of SOM: Mike Conner, Andy Martin, and Larry Raper.


From the Back Cover

Putting Metaclasses to Work takes a new, evolutionary look at important concepts of object-oriented programming, starting with the development of an object model from fundamental principles. Unique aspects of this object model include a use of metaclasses to encapsulate the implementation of object properties and a support for reuse of metaclasses. Metaclass reuse is based on a new semantics for inheritance that automatically combines metaclasses by using multiple inheritance to compose object properties.

This book provides a concrete demonstration of how metaclasses can be used to increase productivity and reusability in object-oriented programming. A C++-based language for programming metaclasses according to the authors' model is presented and then used throughout the book, allowing the reader to understand the utility and importance of metaclasses within the overall context of object-oriented programming. In addition, this book:

Presents the theory of reflective class-based object-oriented models Introduces a new form of inheritance called Inheritance of Metaclass Constraints Discusses the basic metaobject protocol used to program new metaclasses that isolate reusable properties Contains useful examples of metaclasses that can be built with metaobject protocol and cooperative metaclasses



New York Times best sellers
Browse the New York Times best sellers in popular categories like Fiction, Nonfiction, Picture Books and more. See more

Product Details

  • Paperback: 320 pages
  • Publisher: Addison-Wesley Pub (Sd) (October 1998)
  • Language: English
  • ISBN-10: 0201433052
  • ISBN-13: 978-0201433050
  • Product Dimensions: 7.3 x 0.6 x 9.1 inches
  • Shipping Weight: 1.3 pounds
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Best Sellers Rank: #2,803,116 in Books (See Top 100 in Books)

Important Information

Example Ingredients

Example Directions

Customer Reviews

5 star
4 star
3 star
2 star
1 star
See all 4 customer reviews
Share your thoughts with other customers

Top Customer Reviews

Format: Paperback
Too bad this is out of print; I keep referring to it as the best tutorial I know for the difficult subject of cooperative multiple inheritance, supported by Python via the super() function.
1 Comment 16 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This book is a difficult read, but well worth the effort. It takes you through the motivation for metaobjects, the implementation and intricacies of the metaobject protocol, and finally some examples that prove the power of the metaobjects.
Comment 5 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
Book was in great condition and was delivered before the estimated date. would definately use them again.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
The book is a difficult read, but well worth the effort. It explains all of the implementation, details, intricacies, and finally the power and advantages of metaclasses.
Comment 2 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse