| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | idea for program |
PF> > jl> - how the info written in the "Environment" page > jl> should be saved? > > Hmmm; I'd say in an EA attached to the exe -- that way, > when the exe is erased, the env data goes with it. PF> No. The environment information is part of the program object itself, and not necessarily attached to any one executable. You can, after all, *change* which executable is invoked when the object is opened by altering the program name field in the first page. As such, the environment information should be stored in the same place that all of the other object data are saved. The WPObject class provides methods that save and restore data to and from an unspecified persistent store. WPObject is an abstract base class in this respect, since these methods are actually implemented by the immediately derived classes. WPFileSystem saves information to honest-to-goodness files; WPAbstract saves information to INI files; and WPTransient has just dummy functions for the persistency methods, since transient objects are not persistent. What each derived class is expected to do is to override wpSaveState and wpRestoreState to save and restore any data specific to the derived class (using wpSaveData, wpRestoreString, and so forth), and to call the base class methods so that the data in the base class(es) are saved as well. The point being that there is a supplied means for saving the data for an object to persistent store, and you should use it unless you have a *very* good reason not to. One reason to do so (in addition to the simple "because that's what you *should* do") is that were someone to come along and re-implement the persistency methods for WPProgram so that they overrode those supplied by WPAbstract (your proposed WPProgramWithEnvironment class is derived from WPProgram, which is in turn derived from WPAbstract), all instances of your class would save their data to and from the new storage system without any intervention on your part. > JdeBP < ___ X MegaMail 2.10 #0: --- Maximus/2 3.00* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4) SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515 SEEN-BY: 712/517 628 713/888 800/1 7877/2809 @PATH: 440/4 141/209 270/101 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.