9 used & new from $20.88

Have one to sell? Sell yours here
 
 
Putting Metaclasses to Work
 
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get your Kindle here.
 
  

Putting Metaclasses to Work (Paperback)

~ (Author)
5.0 out of 5 stars  See all reviews (3 customer reviews)


Available from these sellers.


8 used from $20.88 1 collectible from $150.00

Customers Who Bought This Item Also Bought

The Art of the Metaobject Protocol

The Art of the Metaobject Protocol

by Gregor Kiczales
4.5 out of 5 stars (4)  $30.97
Explore similar items

Editorial Reviews

Product Description

Metaclasses offer great promise to the world of object-oriented programming The authors present a specific "instruction set" for programming metaclasses and use this set to illustrate how metaclasses fit into the object-oriented programming paradigm.


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.

0201433052P04062001


Product Details

  • Paperback: 300 pages
  • Publisher: Addison Wesley Longman (October 1998)
  • Language: English
  • ISBN-10: 0201433052
  • ISBN-13: 978-0201433050
  • Product Dimensions: 9.2 x 7.3 x 0.6 inches
  • Shipping Weight: 1.2 pounds
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon.com Sales Rank: #890,291 in Books (See Bestsellers in Books)

More About the Author

Ira R. Forman
Discover books, learn about writers, read author blogs, and more.

Visit Amazon's Ira R. Forman Page

Look Inside This Book


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(1)

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

3 Reviews
5 star:
 (3)
4 star:    (0)
3 star:    (0)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
5.0 out of 5 stars (3 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
5 of 6 people found the following review helpful:
5.0 out of 5 stars This book contributed to the design for metaclasses in Python 2.2, April 24, 2007
By Guido van Rossum (California, USA) - See all my reviews
(REAL NAME)   
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.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
4 of 6 people found the following review helpful:
5.0 out of 5 stars This is a book worth owning, December 12, 2000
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 Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
2 of 4 people found the following review helpful:
5.0 out of 5 stars This is a book worth owning, December 12, 2000
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 Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Only search this product's reviews



Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Discussion Replies Latest Post
Textbooks for Kindle DX? 61 2 days ago
textbook scam 66 7 days ago
Amazon is a great place to buy textbooks! 35 19 days ago
Search Customer Discussions
Search all Amazon discussions
   



So You'd Like to...


Create a guide

Product Information from the Amapedia Community

Beta (What's this?)


Look for Similar Items by Category


Look for Similar Items by Subject

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.



Your Recent History

 (What's this?)

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.