Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!agate!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: MacApp examples Was: Local/AppleTalk Connectivity in MacApp Message-ID: <14595@hoptoad.uucp> Date: 7 Jan 91 07:07:38 GMT References: <34241.27875335@stjhmc.fidonet.org> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Electronics for Imaging, San Bruno CA Lines: 34 In article <34241.27875335@stjhmc.fidonet.org> Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) writes: >It should not be necessary for the Application/document classes to know about >everything: why should they? If they know about a class, and THAT class knows >about some class that it uses, the interface for the second class need not specify >a subclass, merely the parent (hopefully something already in MacAPP), THEN >the implementation section of the second class should use the Unit of the sub-class >and typecast the parent class var to the sub-class. This speeds up compile times >by a factor of 2 or more. Typecasting is an ugly thing, and one would hope that good object code would be able to get along without it in most cases. Sure, you can reduce dependencies just by making every field of type TObject, and typecasting as needed, but that's pretty nasty. Nor does it help to decouple classes from each other (i.e., more reusable). If anything, the typecasting solution makes them more interdependent. What would really help would be partial type binding in Object Pascal, so that only fields that are used need to be of a known type. This creates problems with the binding of structure offsets, which could be solved either through a smarter link phase or by the ability to declare forward classes (so that their sizes are known at the time their owning class is declared). -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "American women, especially some of those on the net, might profit by being less concerned with their careers and more concerned with getting a good, old fashioned roll in the hay." -- William J. Fallon, wjf@cbnews.att.com, on soc.women (also uses the alias Walter J. Ficklestein)