Programming Books C Java PHP Python Learn more Browse Programming Books

Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 
Sell Us Your Item
For a $6.03 Gift Card
Trade in
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Putting Metaclasses to Work [Paperback]

by Ira R. Forman
5.0 out of 5 stars  See all reviews (4 customer reviews)


Available from these sellers.


Free Two-Day Shipping for College Students with Amazon Student

Sell Us Your Books
Get up to 80% back when you sell us your books, even if you didn't buy them at Amazon. Learn more

Book Description

October 1998 0201433052 978-0201433050
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 0201433052B04062001

Customers Who Bought This Item Also Bought


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.

0201433052P04062001

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

0201433052B04062001


Product Details

  • Paperback: 320 pages
  • Publisher: Addison-Wesley Pub (Sd) (October 1998)
  • Language: English
  • ISBN-10: 0201433052
  • ISBN-13: 978-0201433050
  • Product Dimensions: 9.1 x 7.3 x 0.6 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,544,760 in Books (See Top 100 in Books)

More About the Author

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

Customer Reviews

5.0 out of 5 stars
(4)
5.0 out of 5 stars
4 star
0
3 star
0
2 star
0
1 star
0
Share your thoughts with other customers
Most Helpful Customer Reviews
12 of 12 people found the following review helpful
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.
Was this review helpful to you?
4 of 6 people found the following review helpful
5.0 out of 5 stars This is a book worth owning December 12, 2000
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 | 
Was this review helpful to you?
5.0 out of 5 stars timely and in great condition October 4, 2010
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?
2 of 4 people found the following review helpful
5.0 out of 5 stars This is a book worth owning December 12, 2000
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 | 
Was this review helpful to you?
Search Customer Reviews
Only search this product's reviews
ARRAY(0xa6a08b64)

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

Forums

There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
Topic:
First post:
Prompts for sign-in
 



Look for Similar Items by Category