Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cmcl2!lanl!beta!egdorf From: egdorf@zaphod.lanl.gov (Skip Egdorf) Newsgroups: comp.object Subject: Re: the need for classes as objects Message-ID: Date: 1 Sep 90 05:25:55 GMT References: <2259@esquire.UUCP> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 55 In-reply-to: yost@esquire.UUCP's message of 28 Aug 90 15:33:31 GMT In article <2259@esquire.UUCP> yost@esquire.UUCP (David A. Yost) writes: > I've heard lispers and smalltalkers say that > the ability of their languages to create > classes at runtime is very powerful, ... > > Would some of you who have used this feature > please give us some great examples of its use > and perhaps show how horrible the workaround > would have to be in a language that doesn't > support it? ... I can give one example from my current domain of discrete event simulation. In a simulation that includes modelling of decision processes, those decision process may decide to instantiate new classes of objects. The domain of possible classes of objects that could be decided upon can be very large; so large in fact that all could not be configured in any current implementation. A weak analogy would be be a compiler that works by explicitly (rather than implicitly) representing all possible strings of a language. The particular example in mind is a simulation of an air combat system where a particular situation results in the configuration of a squadron of aircraft composed of a particular airframe, a particular set of sensors, a particular set of weapons, a particular type of crew, etc. A runtime creation of a class of these aircraft, with a squadron built from instances created from this class, is a rather nice implementation. The number of possible classes, when all the various "mixins" are considered can be quite large. > ... I'm sure dynamic classes must > make development environments better, but I'm > particularly interested in examples not > related to issues of the development > environment. > > --dave yost > yost@dpw.com or uunet!esquire!yost The line between development environment and delivery system can be thin as well. Consider an analyst using the simulation system above to answer some question about use of air power. The analyst will produce a scenario describing an initial state of the model that will contain a squadron of these aircraft here and another squadron over there... Is the initialization of the model, with dynamic class creation from the scenario scripts, a development environment? The Analyst, considering the simulation model as an environment for exploring the use of air power, might answer "Yes" while the programmer, considering the simulation model an end product, would answer "No." Skip Egdorf hwe@lanl.gov