page15.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 69 行
HTML
69 行
<HTML><HEAD><TITLE>Object Hierarchies and Design Patterns</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html1371" HREF="page16.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html1369" HREF="page10.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html1363" HREF="page14.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html1373" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION001300000000000000000">Object Hierarchies and Design Patterns</A></H1><P>There is more to object-oriented programming thansimply encapsulating in an object some data and the procedures for manipulating those data.Object-oriented methods deal also with the <em>classification</em> of objectsand they address the <em>relationships</em> between different classes of objects.<P>The primary facility for expressing relationships between classesof objects is <em>derivation</em>--new classes can be derived from existing classes.What makes derivation so useful is the notion of <em>inheritance</em>.Derived classes <em>inherit</em> the characteristics of the classesfrom which they are derived.In addition,inherited functionality can be overriddenand additional functionality can be defined in a derived class.<P>A feature of this book is thatvirtually all the data structures are presented in the contextof a single class hierarchy.In effect,the class hierarchy is a taxonomy of data structures.Different implementations of a given abstract data structureare all derived from the same abstract base class.Related base classes are in turn derived fromclasses that abstract and encapsulate the common features of those classes.<P>In addition to dealing with hierarchically related classes,experienced object-oriented designers also consider very carefullythe interactions between unrelated classes.With experience,a good designer discovers the recurringpatterns of interactions between objects.By learning to use these patterns,your object-oriented designs will become more flexible and reusable.<P>Recently, programmers have to started name the common design patterns.In addition, catalogs of the common patterns are nowbeing compiled and published[<A HREF="page610.html#gamma">15</A>].<P>The following <em>object-oriented design patterns</em>are used throughout this text:<P><BR> <HR><UL> <LI> <A NAME="tex2html1374" HREF="page16.html#SECTION001301000000000000000">Containers</A><LI> <A NAME="tex2html1375" HREF="page17.html#SECTION001302000000000000000">Iterators</A><LI> <A NAME="tex2html1376" HREF="page18.html#SECTION001303000000000000000">Visitors</A><LI> <A NAME="tex2html1377" HREF="page19.html#SECTION001304000000000000000">Cursors</A><LI> <A NAME="tex2html1378" HREF="page20.html#SECTION001305000000000000000">Adapters</A><LI> <A NAME="tex2html1379" HREF="page21.html#SECTION001306000000000000000">Singletons</A></UL><HR><A NAME="tex2html1371" HREF="page16.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html1369" HREF="page10.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html1363" HREF="page14.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html1373" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright © 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a> All rights reserved.</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?