Introduction to Design Patternalns in Delphi

zhaozj2021-02-11  239

Introduction to Design Patternal Was Presented by James Heyworth To The Canberra PC Users Group Delphi Sig 11/11/1996. Please send comments and suggestions to james@obsof.com.

Contents Introduction How Delphi Helps You Define Patterns Delphi Examples of Design Patterns Pattern: Singleton Pattern: Adapter Pattern: Template Method Pattern: Builder Pattern: Abstract Factory Pattern: Factory Method Appendix: Key Elements of Delphi Class Definitions Bibliography Download Paper and Source Code Examples

Introduction Design patterns are frequently recurring structures and relationships in object-oriented design. Getting to know them can help you design better, more reusable code and also help you learn to design more complex systems. Much of the ground-breaking work on design patterns was presented in the book Design Patterns:. Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson and Vlissides you might also have heard of the authors referred to as "the Gang of Four" If you have not read this book before. and you're designing objects, it's an excellent primer to help structure your design. to get the most out of these examples, I recommend reading the book as well. This paper takes some sample patterns from Design Patterns and discusses their implementation in Delphi. Another Good Source of Pattern Concepts is The Book Object Models: Strategies, Patterns and Applications by Peter COAD. COAD'S Examples Are More Business Oriented and He Emphasses Learning Strategies Toes Identify patterns in your OWN WORK.

How Delphi Helps You Define Patterns Delphi implements a fully object-oriented language with many practical refinements that simplify development. A summary of Delphi class concepts can be found in the following appendix. The most important class attributes a pattern perspective from are the basic inheritance of classes; virtual and abstract methods;. and use of protected and public scope These give you the tools to create patterns that can be reused and extended, and let you isolate varying functionality from base attributes that are unchanging Delphi is a great example of an. extensible application, through its component architecture, IDE interfaces and tool interfaces. These interfaces define many virtual and abstract constructors and operations.Delphi Examples of Design Patterns I should note from the outset, there may be alternative or better ways to implement these patterns and I Welcome your suggestions on ways to improve the design. The folload pattern from the book design .

Pattern NameDefinitionSingleton "Ensure a class has only one instance, and provide a global point of access to it." Adapter "Convert the interface of a class into another interface clients expect. Adapter lets classes work together that could not otherwise because of incompatible interfaces . "Template Method" Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. "Builder" Separate the construction of a complex object from its representation so that the same construction process can create different representations. "Abstract Factory" Provide an interface for creating families of related or dependant objects without specifying their concrete classes. "Factory Method" Define an interface for creating an object, but let subclasses decide which class To Instantiate. Factory Method Lets a class defer instantiation to subclasses. "NOTE: THESE DEFINI TIONS Are Taken from Design Patterns.

Pattern: Singleton Definition "Ensure a class has only one instance, and provide a global point of access to it." This is one of the easiest patterns to implement Applications in Delphi There are several examples of this sort of class in the Delphi VCL. , such as TApplication, TScreen or TClipboard. The pattern is useful whenever you want a single global object in your application. Other uses might include a global exception handler, application security, or a single point of interface to another application. Implementation Example to implement a class of this type, override the constructor and destructor of the class to refer to a global (interface) variable of the class. Abort the constructor if the variable is assigned, otherwise create the instance and assign the variable. In the destructor, clear THE VARIABLE ITEFERS TOE: To Make The Creation and Destruction of the Single Instance Automatic, include ITATION IN THE Initialization Secti on of the unit. To destroy the instance, include its destruction in an ExitProc (Delphi 1) or in the finalization section of the unit (Delphi 2). The following Delphi 1 example illustrates two singleton classes, one derived from TComponent and another derived From TOBJECT.Unit Singletn;

Interface

Uses

Sysutils, Wintypes, WinProcs, Messages, Classes, Graphics, Controls,

Forms, Dialogs;

Type

Tcsingleton = Class (Tcomponent)

public

Constructor Create (Aowner: Tcomponent); OVERRIDE;

DESTRUCTOR DESTROY; OVERRIDE;

END;

Tosingleton = Class (TOBJECT)

public

Constructor crete;

DESTRUCTOR DESTROY; OVERRIDE;

END;

VAR

Global_csingleton: tcsingleton;

Global_osingleton: Tosingleton;

PROCEDURE register;

IMPLEMentation

Procedure register; begin

RegisterComponents ('Design Patterns', [TCSingleton]);

END;

{TCSINGLETON}

Constructor Tcsingleton.create (Aowner: Tcomponent);

Begin

IF global_csingleton <> nil dam

{NB Could show a message or raise a Different Exception HERE}

Abort

Else Begin

Inherited Create (Aowner);

Global_csingleton: = Self;

END;

END;

DESTRUCTOR TCSINGLETON.DESTROY;

Begin

IF global_csingleton = self kil

Global_csingleton: = NIL;

Inherited destroy;

END;

{Tosingleton}

Constructor tosingleton.create;

Begin

IF global_osingleton <> nil dam

{NB Could show a message or raise a Different Exception HERE}

Abort

Else

Global_osingleton: = Self;

END;

Destructor Tosingleton.DESTROY DESTRUCTOR

Begin

IF global_osingleton = self kil

Global_osingleton: = NIL;

Inherited destroy;

END;

PROCEDURE FREEGLOBALOBAABACTS; FAR;

Begin

IF global_csingleton <> nil dam

Global_csingleton.free;

IF global_osingleton <> nil dam

Global_osingleton.free;

END;

Begin

AddExitProc (FreeGlobalObjects);

End.

Pattern: Adapter Definition ".. Convert the interface of a class into another interface clients expect Adapter lets classes work together that could not otherwise because of incompatible interfaces" Applications in Delphi A typical example of this is the wrapper Delphi generates when you import a VBX or OCX. Delphi generates a new class which translates the interface of the external control into a Pascal compatible interface. Another typical case is when you want to build a single interface to old and new systems. Note Delphi does not allow class adaption through multiple inheritance in the way described in Design Patterns. Instead, the adapter needs to refer to a specific instance of the old class. Implementation Example The following example is a simple (read only) case of a new customer class, an adapter class and an old Customer Class. The Adapter Illustrates Handling The Year 2000 Problem, Translating An Old Customer Record Containing Two Digit Years Into A New Date Format. The C lient using this wrapper only knows about the new customer class Translation between classes is handled by the use of virtual access methods for the properties The old customer class and adapter class are hidden in the implementation of the unit.unit Adapter..;

Interface

Uses sysutils, classes;

Type

{The new class}

TNewCustomer = Class

Private

FCustomerid: longint;

Ffirstname: string;

Flastname: String;

FDOB: TDATETIME;

protected

Function GetCustomerid: longint; virtual;

Function GetFirstname: String; Virtual;

Function GetLastname: string; Virtual;

Function GETDOB: TDATETIME; Virtual;

public

Constructor Create (Custid: Longint); Virtual;

Property Customerid: Longint Read GetCustom;

Property firstname: string read getfirstname; Property Lastname: String Read GetLastname

Property Dob: TDATETIME READ GETDOB;

END;

{An interface method}

{Lets US Hide Details of ToldCustomer from The Client}

Function GetCustom (Customerid: longint): TNewCustomer;

IMPLEMentation

Const

Last_OLDCUSTOMER_AT_YEAR_2000 = 15722;

Last_OLDCUSTOMER_IN_DATABASE = 30000;

{The new class}

Constructor TNewCustomer.create (Custid: Longint);

Begin

Fcustomerid: = CustId;

Ffirstname: = 'a';

FLASTNAME: = 'new_customer';

FDOB: = NOW;

END;

Function TNewCustomer.getCustomerid: longint;

Begin

Result: = fcustomerid;

END;

Function TNewcustomer.GetFirstname: String;

Begin

RESULT: = ffirstname;

END;

Function TNewCustomer.getlastname: String;

Begin

Result: = FlastName;

END;

Function TNewCustomer.getdob: tdatetime;

Begin

Result: = fdob;

END;

Type

{THE OLD CLASS}

ToldDOB = Record

Day: 0..31;

Month: 1..12;

Year: 0..99;

END;

ToldCustomer = Class

Fcustomerid: integer;

FNAME: STRING;

FDOB: ToldDob;

public

Constructor create (Custid: integer);

Property Customerid: Integer Read Fcustomerid;

Property Name: String Read Fname;

Property Dob: ToldDob Read FDOB;

END;

Constructor ToldCustomer.create (CustId: Integer);

Begin

Fcustomerid: = CustomerId;

FNAME: = 'an old_customer';

With fdob do begin

Day: = 1;

Month: = 1;

Year: = 1;

END;

END;

Type

{The adapter class}

TadaptedCustomer = Class (TNewCustomer)

Private

FoldCustomer: ToldCustomer;

protected

Function getCustomerid: longride;

Function getFirstname: string; override;

Function GetLastname: string; override;

Function GETDOB: TDATETIME; OVERRIDE; Public

Constructor Create (Custid: Longint); OVERRIDE;

DESTRUCTOR DESTROY; OVERRIDE;

END;

{The adapter class}

Constructor TadaptedCustomer.create (Custid: Longint);

Begin

Inherited Create (CustId);

FoldCustomer: = ToldCustomer.create (CustID);

END;

Destructor tadaptedcustomer.destroy;

Begin

Foldcustomer.free;

Inherited destroy;

END;

Function TadaptedCustomer.getCustomerid: longint;

Begin

Result: = foldcustomer.customerid;

END;

Function tadaptedcustomer.getfirstname: String;

VAR

Spacepos: integer;

Begin

Spacepos: = POS ('', foldcustom.name);

IF spacepos = 0 THEN

Result: = ''

Else

Result: = COPY (FoldCustomer.Name, 1, SpacePOS-1);

END;

Function TadaptedCustomer.getlastname: String;

VAR

Spacepos: integer;

Begin

Spacepos: = POS ('', foldcustom.name);

IF spacepos = 0 THEN

Result: = foldcustomer.name

Else

Result: = COPY (FoldCustomer.Name, SpacePOS 1, 255);

END;

Function TadaptedCustomer.getdob: TDATETIME;

VAR

Fullyear: Word;

Begin

IF Customerid> Last_OLDCUSTOMER_AT_YEAR_2000 THEN

Fullyear: = 2000 foldcustom.dob.Year

Else

Fullyear: = 1900 foldcustom.dob.Year;

Result: = Encodedate (fullear, foldcustomer.dob.month, foldcustomer.dob.day);

END;

Function GetCustom (Customerid: longint): TNewCustomer;

Begin

If Customerid> Last_oldcustomer_in_database the

Result: = TNewCustomer.create (Customerid)

Else

Result: = tadaptedcustomer.create (Customerid) As TNewCustomer;

END;

End.

Pattern: Template Method Definition ". Define the skeleton of an algorithm in an operation, deferring some steps to subclasses Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure."

This pattern is essentially an extension of abstract methods to more complex algorithms. Applications in Delphi Abstraction is implemented in Delphi by abstract virtual methods. Abstract methods differ from virtual methods by the base class not providing any implementation. The descendant class is completely responsible for implementing an abstract method. Calling an abstract method that has not been overridden will result in a runtime error. A typical example of abstraction is the TGraphic class. TGraphic is an abstract class used to implement TBitmap, TIcon and TMetafile. Other developers have frequently used TGraphic as the basis for other graphics objects such as PCX, GIF, JPG representations. TGraphic defines abstract methods such as Draw, LoadFromFile and SaveToFile which are then overridden in the concrete classes. Other objects that use TGraphic, such as a TCanvas only know about the Abstract Draw Method, YET Are Used with The Concrete Class At Runtime. Many Classes That USE C omplex algorithms are likely to benefit from abstraction using the template method approach. Typical examples include data compression, encryption and advanced graphics processing. Implementation Example To implement template methods you need an abstract class and concrete classes for each alternate implementation. Define a public interface to an algorithm in an abstract base class. in that public method, implement the steps of the algorithm in calls to protected abstract methods of the class. in concrete classes derived from the base class, override each step of the algorithm with a concrete implementation specific to That Class.

This Example Shows Some Very Simple Alogrithm Steps, But Illustrate The Principle of Deferring Implementation To a Subclass.Unit TPL_METH;

Interface

Type

TabstractTemplateClass = Class (TOBJECT)

protected

Function Algorithm_Stepa: Integer; Virtual; ABSTRACT;

Function Algorithm_Stepb: Integer; Virtual; Abstract;

Function Algorithm_Stepc: Integer; Virtual; ABSTRACT;

public

Function algorithm: integer;

END;

Tconcreteclassa = Class (TabstractTemplateClass)

protected

Function Algorithm_Stepa: Integer; Override;

Function Algorithm_Stepb: Integer; Override;

Function algorithm_stepc: integer; override;

END;

Tconcreteclassb = Class (TabstractTemplateClass)

protected

Function Algorithm_Stepa: Integer; Override;

Function Algorithm_Stepb: Integer; Override;

Function algorithm_stepc: integer; override;

END;

Pattern: Builder Definition "Separate the construction of a complex object from its representation so that the same construction process can create different representations." A Builder seems similar in concept to the Abstract Factory The difference as I see it is the Builder refers to single. complex objects of different concrete classes but containing multiple parts, whereas the abstract factory lets you create whole families of concrete classes. for example, a builder might construct a house, cottage or office. you might employ a different builder for a brick house or a timber house, though you would give them both similar instructions about the size and shape of the house. On the other hand the factory generates parts and not the whole. It might produce a range of windows for buildings, or it might produce a quite different ........................... Delphi creates forms using a common interface, through Application.CreateForm and through the TForm class constructor. TForm implements a common constructor using the resource information (DFM file) to instantiate the components owned by the form. Many descendant classes reuse this same construction process to Create DiffERENT REPRESENTATIONS. DELPHI Also Makes Developer Extensions Easy. TFORM '

s OnCreate event also adds a hook into the builder process to make the functionality easy to extend. Implementation Example The following example includes a class TAbstractFormBuilder and two concrete classes TRedFormBuilder and TBlueFormBuilder. For ease of development some common functionality of the concrete classes has been moved INTO The Shared TabstractFORMBUILDER Class.Type

TabstractFormBuilder = Class

Private

FFORM: TFORM;

Procedure BuilderformClose (Sender: Tobject; VAR Action: Tclosection);

protected

Function Getform: TFORM; Virtual;

public

Procedure Createform (Aowner: Tcomponent); Virtual;

.................

.

...............

Property Form: TForm ReadForm;

END;

Type

TREDFORMBUILDER = Class (TabstractFormBuilder)

Private

FnextLeft, Fnexttop: Integer;

public

Procedure Createform (Aowner: Tcomponent); OVERRIDE;

Procedure CreatespeedButton; Override;

Procedure CreateEdit; OVERRIDE;

Procedure CreateLabel; OVERRIDE;

END;

Type

TBLueFormBuilder = Class (TabstractFormBuilder)

Private

FnextLeft, Fnexttop: Integer;

public

Procedure Createform (Aowner: Tcomponent); OVERRIDE;

Procedure CreatespeedButton; Override;

Procedure CreateEdit; OVERRIDE;

Procedure CreateLabel; OVERRIDE;

END;

At Runtime The Client Application Instructs One of the Concrete Classes To create Parts Using the public Part Creation Procedures. The Concrete Builder Instance Is Passed To The Folliwing Procedure:

Procedure TFORM1.CREATE3ComponentformusingBuilder (Abuilder: TabstractFormMbuilder);

VAR

Newform: TForm;

Begin

With Abuilder Do Begin

Createform (Application);

Createedit;

Createspeedbutton;

CreateLabel;

Newform: = form;

IF newform <> nil the newform.show;

END;

END;

Pattern: Abstract Factory Definition ". Provide an interface for creating families of related or dependant objects without specifying their concrete classes" The Factory Method pattern below is commonly used in this pattern Applications in Delphi This pattern is ideal where you want to isolate your application. from the implementation of the concrete classes. for example if you wanted to overlay Delphi's VCL with a common VCL layer for both 16 and 32 bit applications, you might start with the abstract factory as a base. Implementation Example The following example uses an abstract factory And Two Concrete Factory Classes to Implement Different Styles of User Interface Components. ToabstractFactory IS A Singleton Class, Since We Used for the Whole Application.

ToabstractFactory = Class (TOBJECT)

public

Constructor crete;

DESTRUCTOR DESTROY; OVERRIDE;

{Abstract Widget Constructors}

Function CreatespeedButton (Aowner: Tcomponent): TspeedButton; Virtual; ABSTRACT;

Function CreateEdit (Aowner: Tcomponent): Tedit; Virtual; Abstract

Function CreateLabel (Aowner: Tcomponent): TLABEL; Virtual; Abstract

END;

ToredFactory and ToblueFactory Override The Abstract Interface to Support Different Widget STYLES.

ToredFactory = Class (ToabstractFactory)

public

{Concrete Widget Constructors}

Function CreatespeedButton (Aowner: Tcomponent): TspeedButton; Override;

Function CreateEdit (Aowner: Tcomponent): TEDIT; OVERRIDE;

Function CreateLabel (Aowner: Tcomponent): TLABEL; OVERRIDE

END;

ToblueFactory = Class (ToabstractFactory)

public

{Concrete Widget Constructors}

Function CreatespeedButton (Aowner: Tcomponent): TspeedButton; Override; Function CreateEdit (Aowner: Tcomponent): Tedit; OVERRIDE

Function CreateLabel (Aowner: Tcomponent): TLABEL; OVERRIDE

END;

At runtime, our client application instantiates the abstract factory with a concrete class and then uses the abstract interface. Parts of the client application that use the factory do not need to know which concrete class is actually in use.

Pattern: Factory Method Definition "Define an interface for creating an object, but let subclasses decide which class to instantiate Factory method lets a class defer instantiation to subclasses.." The Abstact Factory pattern can be viewed as a collection of Factory Methods Applications in. Delphi This pattern is useful when you want to encapsulate the construction of a class and isolate knowledge of the concrete class from the client application through an abstract interface. One example of this might arise if you had an object oriented business application potentially interfacing to multiple target DBMS. The client application only wants to know about the business classes, not about their implementation-specific storage and retrieval. Implementation Example In the Abstract Factory example, each of the virtual widget constructor functions is a Factory Method. In their implementation we define a Specific Widget Class To Return.

TredspeedButton = Class (tspeedbutton)

public

Constructor Create (Aowner: Tcomponent); OVERRIDE;

END;

Constructor TredspeedButton.create (Aowner: Tcomponent);

Begin

Inherited Create (Aowner);

Font.color: = CLRED;

END;

Function ToredFactory.createspeedButton (Aowner: Tcomponent): TspeedButton;

Begin

Result: = TREDspeedButton.create (Aowner);

Appendix: Key Elements of Delphi Class Definitions Unit Structure Delphi units (.PAS files) allow declaration of interface and implementation sections The interface defines the part that is visible to other units using that unit The keyword uses can be added to a unit's interface.. or implementation section to list the other units that your unit uses. This indicates to the compiler that your unit refers to parts of the used unit's interface. Parts of a unit declared in the implementation section are all private to that unit, ie never visible to any other unit. types, functions and procedures declared in the interface of a unit must have a corresponding implementation, or be declared as external (eg a call to a function in a DLL). Class Interfaces Classes are defined as types in Delphi and may Contain Fields of Standard Data Types or Other Objects or Procedures, And Properties. The Type Declaration of A Class Defines ITERFACE AND THE SCOPE OF AC cess to fields, methods and properties of the class. Class interfaces are usually defined in the interface of a unit to make them accessible to other modules using that unit. However they do not need to be. Sometimes a type declaration of a class may be used only within the implementation part of a unit. Properties Properties are a specialised interface to a field of a defined type, allowing access control through read and write methods. Properties are not virtual, you can replace a property with another property of the same Name, But The Parent Class Doesn't Know About The New Property. It is however Possible to make the access methods of a property virtual. inheritance delphi '

s inheritance model is based on a single hierarchy. Every class inherits from TObject and can have only one parent. A descendant class inherits all of the interface and functionality of its parent class, subject to the scope described below. Multiple inheritance from more than one parent is not allowed directly. It can be implemented by using a container class to create instances one or more other classes and selectively expose parts of the contained classes. Private, Protected, Public and Published Scope Scope refers to the visibility of methods and data defined in the interface of a class, ie what parts of the class are accessible to the rest of the application or to descendant classes. The default scope is public, for instance the component instances you add to a form at design time. public says "come And get Me "; It Makes The Data or Method Visible to Everything at Runtime. Published Parts of a class area A Specialized form of public scope. They Indicate Special Behaviour for CLA sses derived from TPersistent. A persistent class can save and restore its published properties to persistent storage using Delphi's standard streaming methods. Published properties also interact with Delphi Object Inspector in the IDE. A class must descend from TPersistent in order to use Published. There's also not much point in publishing methods, since you can not store them, although Delphi's compiler does not stop you. Published also lets another application access details of the class through Delphi's runtime type information. This would be rarely used, except in Delphi '

s design time interaction with its VCL. Encapsulation or information hiding is essential to object orientation, so Protected and Private scope let you narrow the access to parts of a class. Protected parts are visible only to descendant classes, or to other classes defined in the same unit. Private parts are visible only to the defining class, or to other classes defined in the same unit. It's important to note that once something is given public or published scope, it can not be hidden in descendant classes. Static, Virtual and Dynamic Methods;. Override and Inherited Methods declared as virtual or dynamic let you change their behaviour using override in a descendant class you're unlikely to see a virtual method in the private part of a class, since it could only be overridden in the same unit Although Delphi's Compiler Doesn't Stop You From Doing this. Override Indicates That Your New Method Replaces The Method of The Same Name from The Parent Class. The Override Must Be Declared Wi th the same name and parameters as the original method. When a method is overridden, a call to the parent class's method actually executes the override method in the real class of the object. Static methods on the other hand have no virtual or override declaration. you can replace a method of a class in a descendant class by redeclaring another method, however this is not object oriented. If you reference your descendant class as the parent type and try to call the replaced method, the static method of the parent class is Executed. so in MOST CASES, IT '

sa bad idea to replace a static method. Virtual and dynamic methods can be used interchangeably. They differ only in their treatment by the compiler and runtime library. Delphi's help explains that dynamic methods have their implementation resolved at compile time and run slightly faster, whereas virtual methods are resolved at runtime, resulting in slightly slower access but a smaller compiled program. Virtual is usually the preferred declaration. Delphi's help suggests using dynamic when you have a base class with many descendants that may not override the method. The inherited directive lets you refer back to a property or method as it was declared in the parent class. This is most often used in the implementation of an override method, to call the inherited method of the parent class and then supplement its behaviour. Abstract Methods Abstract is used IN base classes to declare a method in the interface and deflicant class. IE it defines an inTerf ace, but not the underlying operation. Abstract must be used with the virtual or dynamic directive. Abstract methods are never implemented in the base class and must be implemented in descendant classes to be used. A runtime error occurs if you try to execute an abstract Method That Is Not Overridden. Calling Inherited With Override Implementation of An Abstract Method Will Also Result In a Runtime Error, Since the the no inherited behaviour. Messages Delphi '

s handling of Windows messages is a special case of virtual methods. Message handlers are implemented in classes that descend from TControl. Ie classes that have a handle and can receive messages. Message handlers are always virtual and can be declared in the private part of a class interface, yet still allow the inherited method to be called. Inherited in a message handler just uses the keyword inherited, there is no need to supply the name of the method to call. Events Events are also an important characteristic of Delphi, since they .. let you delegate extensible behaviour to instances of a class Events are properties that refer to a method of another object Events are not inherited in Delphi 1; Delphi 2 extends this behaviour to let you use inherited in an event Inherited in an event.. Handler Just Uses The Keyword Inherited, There Is No Need To Supply The Name of The Method To Call. Events Are Particularly Important To Component Developers, Since The Provide A hook for the user of the component to modify its behaviour in a way that may not be foreseen at the time the component is written. Constructors and Destructors The constructor and destructor are two special types of methods. The constructor initializes a class instance (allocates memory initialized to 0) and returns a reference (pointer) to the object. The destructor deallocates memory used by the object (but not the memory of other objects created by the object). Classes descended from TObject have a static constructor, Create, and a virtual destructor Destroy. Tcomponent Introduces A New Public Property, The Owner of The Component and this Must Be Initialized in The Constructor. Tcomponent '

s constructor is declared virtual, i.e. it can be overridden in descendant classes. It is essential when you override a virtual constructor or destructor in a TComponent descendant to include a call to the inherited method.Bibliography

Design Patterns: Elements of Reusable Object-Oriented Software, Erich Gamma et al, Addison-Wesley, Massachusetts, 1995. Object Models:.. Strategies, Patterns and Applications, Peter Coad et al, Prentice-Hall, New Jersey, 1995. Copyright © 1996, Objective Software Technology Pty Limited. This paper may be freely distributed in its entirety, providing the source is acknowledged. Portions quoted from Design Patterns are Copyright © 1995, Addison Wesley Publishing Company.

转载请注明原文地址:https://www.9cbs.com/read-5307.html

New Post(0)