comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: Persistence of limited tagged types
Date: Mon, 07 Apr 2003 15:07:24 -0400
Date: 2003-04-07T15:07:24-04:00	[thread overview]
Message-ID: <1049742443.855336@master.nyc.kbcfp.com> (raw)
In-Reply-To: <ullymi3ea.fsf@nasa.gov>

Stephen Leake wrote:
> You will have to write a function that reads the external
> representation of the tag, allocates an object of the appropriate
> type, and returns the pointer. Yes, this function must be changed
> every time you add a new tag.

This is known as the Factory pattern. Instead of changing the
function for each new tag, you can have the package that defines
the type enroll a read method into a table of methods. Then the
factory reads the external tag representation, looks it up in
the table, and calls the method if it's present.




  reply	other threads:[~2003-04-07 19:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07 12:47 Persistence of limited tagged types Jano
2003-04-07 14:47 ` Nick Roberts
2003-04-09 10:05   ` Nick Roberts
2003-04-10  3:32     ` tmoran
2003-04-09 23:09   ` Matthew Heaney
2003-04-10 14:40     ` Nick Roberts
2003-04-10 23:37       ` Robert A Duff
2003-04-11 16:39         ` Nick Roberts
2003-04-10 18:49     ` Randy Brukardt
2003-04-10  1:12   ` Matthew Heaney
2003-04-07 18:11 ` Stephen Leake
2003-04-07 19:07   ` Hyman Rosen [this message]
2003-04-07 22:09     ` Jano
2003-04-08 13:58       ` Matthew Heaney
2003-04-10 11:41         ` Julio Cano
2003-04-10 19:14           ` Jano
2003-04-11 12:54             ` Julio Cano
2003-04-07 20:17   ` Robert Spooner
2003-04-07 21:14     ` Stephen Leake
2003-04-08 12:56       ` Robert Spooner
2003-04-08 13:41         ` Jano
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox