Well, no, not exactly. Fileman doesn't have inheritance in the way a language like Java does, but I think it does have subtypes. Think about it this way: Many files have POINTERS for .01 fields. What does this mean? Well, if there is a RADIOLOGY PATIENT file, the .01 field of which points to the PATIENT file, then a RADIOLOGY PATIENT is a kind of PATIENT, and it is relatively easy to retrieve attributes of that patient stored in the PATIENT file. In fact, you could create computed fields to do this if you really wanted to, but this is seldom done.
There is another strategy you sometimes see, and that is configuring one file (using a technique known as DINUM) to use the same internal entry numbers as another file. This saves a level of indirection because you can always use the same index (at the record level) into the global representation of each file if you wish to use direct global reads, and you can use the same DA or IENS in Fileman calls). Unfortunately, though, this comes at a cost: namely, increased coupling. Though there is a small gain in programming convenience, your code becomes more difficult to maintain, so I don't recommend doing this. Returning to the issue of subtypes, Fileman doesn't really support "methods" in the way object oriented languages generally do. Instead, you typically write functions that accept the IEN of a file entry as a parameter. Actually, it was quite an eye opener to me when I realized that I was consistently writing extrinsic functions taking an IEN as the first parameter without cconsciously thinking about WHY I was doing this. Of course, my file was a class, records were objects, and these extrinisc functions were methods. I was doing object oriented programming without even realizing it! Now, in object oriented languages, method dispatch is typically handled internally: That is, a table lookup occurs "behind the scenes" to determine where the method was defined, and then execution of the method is delegated appropriately. When programming Fileman applications, you basically end up doing this delegation manually rather than relying (or, if you will, being able to rely) on the language to handle the mechanics. When diagramming file structures using UML, I generally represent both pointer-valued .01 fields and DINUMed files using the open broad arrow used to represent class/subclass rpresentation. Variable pointers (which are generally rare) can be used to implement multiple inheritance, but are more often used to support a kind of polymorphism. --- Michael Zacharias <[EMAIL PROTECTED]> wrote: > i have been working through the fileman and kernel literature trying > to glean > as much as i can, but have been unable to determine if i can define > supertype > and sub-type file definitions in fileman. for example, if i define a > case > supertype, i would like to define a tb subtype or food poisoning > subtype. the > subtypes would inherit the supertypes data items... > > > thanks... > > > michael > === Gregory Woodhouse <[EMAIL PROTECTED]> "Without the requirement of mathematical aesthetics a great many discoveries would not have been made." -- Albert Einstein ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Hardhats-members mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hardhats-members
