From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,386670df95abccf1 X-Google-Attributes: gid103376,public From: jerry@jvdsys.stuyts.nl (Jerry van Dijk) Subject: Re: ANNOUNCE: Abstract Factory posted to ACM patterns archive Date: 1999/03/08 Message-ID: #1/1 X-Deja-AN: 452708902 References: <7bmcb5$jkf$1@nnrp1.dejanews.com> Organization: * JerryWare *, Leiden, Holland Newsgroups: comp.lang.ada Date: 1999-03-08T00:00:00+00:00 List-Id: Matthew Heaney (matthew_heaney@acm.org) wrote: : "Factory" just has its common meaning: an abstraction that you use to : create other abstractions. This is why it falls under the rubric of : "creational patterns." Different factories create different items. As I recall from the GoF book, my impression (also stated somewhere, I believe) was that one of the essentials was using construction instead of inheritance as the main design principle. The implementation of the idea seems to be decoupling through dispatching and access types. Looking at your example, I see: : type Root_Hamburger_Type (<>) is abstract tagged limited private; : type Hamburger_Access is access all Root_Hamburger_Type'Class; : function New_Hamburger return Hamburger_Access; : function New_Hamburger return Hamburger_Access; : Hamburger : constant Hamburger_Access := Factory.New_Hamburger; With other words, pointers seem to be the essential tool for using this design method. Although the thinking behind the pattern idea is powerful by its rigid application, whenever I try to apply it, I end up with programs that seem to become impregnable through the heavy use of indirection, overloading and dispatching. Gone is the "clear and elegant" (for lack of better wording) ADT based structure I like so much in Ada. Now, it could be that this is indeed true, but I rather suspect that I made a wrong turn somewhere. Anyone who has been there, and solved this problem ? -- -- Jerry van Dijk | Leiden, Holland -- Team Ada | jdijk@acm.org -- see http://stad.dsl.nl/~jvandyk