5 - Forth Interest Group
5 - Forth Interest Group
5 - Forth Interest Group
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
O& je c t - Orien t e d<br />
<strong>Forth</strong><br />
"<br />
/ New Westminster, British Columbia, Canada<br />
I<br />
yourself, but you should<br />
protect your code from what<br />
those other crazy, reckless,<br />
undisciplined hacks might<br />
do. It is possible to de-couple<br />
to the extent of not even<br />
allowing dired reference to<br />
a data type's routines. In-<br />
stead, a message is sent over<br />
to that module asking for a<br />
procedure to be enacted.<br />
Thus, even the data type's<br />
procedures could be modihed<br />
(which might be necessarv<br />
if the details of the data<br />
change), and still it would<br />
not affect any other module.<br />
1<br />
1<br />
n the beginning, there was tion that a routine should do twoflmt-t~~evariablescalled The intent here is to provide<br />
programming. Now, the one thing and only one thing REAL and IMAGINARY) that robust code by limiting side<br />
programming was form- (and do it well). However, data abstraction is important. of changes, and to<br />
less and unstructured- there was more to be discov- A procedure's code is ~~~- provide reusable code by<br />
darkness was over the sur- ered.<br />
saril~s~ecificaboutwhatt~~e de-coupling it from as much<br />
face of the design problem. If a careful study of pro- of data it operates upon. The as possible.<br />
Then came structured cedures proved beneficial, code of + (plus) assumes an The intent of object-oriprogramminpa<br />
disciplined then what about a close look integer data type, and F+ (f- ented programming is to<br />
coding style and a logical at the nature and form of the ~lus)assmesafloating-~int extend the ideas of strucanalysis<br />
technique which data being operated upon data type. These cannot be tured programming to inemphasized<br />
the nature of by those newly-structured swapped (or even duped-- clude techniques dealing<br />
the coupling between code routines? Thus, someone else Your employment may with data which enhance<br />
modules and the design coined the phrase object be over). Thus, it only makes reliability and minireasons<br />
behind the creation o&nW, probably in con- sense to group the definition mize the maintenance of a<br />
of the code modules. Creat- trast to the prevailing proce- of a data type with each and software project by reducing<br />
ing a routine out of code that dure-oriented programming every procedure that will the amount of modifications<br />
just happened to be per- of the time.<br />
operateu~onit-makingfor necessitated by a change.<br />
formed at the same time<br />
easier maintenance. When a<br />
(temporal cohesion) was out<br />
Enter Analysis of Data<br />
data type's definition and its<br />
Glossary<br />
Creating one routine out of<br />
Data canbe kept in atomic<br />
associated procedures are In the object-oriented<br />
code that did a couple of<br />
types like variables, congrouped<br />
into one module, vernacular, a data structure<br />
closely related things Oogistants,<br />
and literals; or in<br />
furtherde-couplingbetween is called an object or an incal<br />
cohesion) was out-it<br />
molecular groupings, such<br />
modules can be realized. For stance of a class. The class<br />
necessitated passing control<br />
as named records and inexample,<br />
a stack can be contains the information<br />
flags between routines (called<br />
dexed arrays. Many early<br />
implemented using an in- necessary to construct an<br />
control coupling, oddly<br />
computer languages prodexed<br />
array, or a buffer and instance, as well as all the<br />
enough). There was (once<br />
vided a small selection of<br />
an offset. Allowing any other routines that operate on its<br />
, again?) the dawning realizaatomic<br />
data types and exmodule<br />
to know the imple- data type. The internal obmentation<br />
details is not nec- jects that make up an inessary<br />
and could allow di- stance Oike fields within a<br />
information hiding is the back= rect aces to elements within record) are called instance<br />
bone of code security, reliable the stack structure. This di- variables. An object is sent a<br />
red access is a potential message, which specifies<br />
re-entrancy, and data abstraction problem for the future, if what to do, but not how to<br />
ever the implementation of do it. The object then finds<br />
( pected you to use records, stack structure is changed. the method the word that<br />
1 for example, to simulate any "What they don't know can't performs the correct action;<br />
Roger Bicknell is an electrical engi- different 'types of data hurt you." Of course, it is<br />
neer who has programmed in <strong>Forth</strong> as<br />
this is called binding the<br />
might fancy. The ability to<br />
a hobby since 1982. He enjoys the<br />
important to keep in mind message to the object. There<br />
simplicity and interactivity of the b- abstract data, or to create a that considerations like are two forms: earlybinding<br />
guage, and uses it to experiment with new data type, is an essential maintenance are far more<br />
language &sign. He says, 'Some<br />
and late (or dynamic) bindfeature<br />
of ah &ject-oriented<br />
people gamble, I program ... Yes, I<br />
complex and important for a ing. Early binding is done at<br />
know it's 4:00 a.m., but I've just got to language<br />
large multi-programmer compile time and dynamic<br />
tweak this one last word ..." Row But it is not sim~lv for the project than for a lone-wolf, binding is done at run time.<br />
welcomes feedback at 315 D&O~ prettiness of beiigdable to<br />
Street. New Westminster, BC, Canada<br />
one-nighter program. You The ability of one class to<br />
V3L 4E8 or at R.BICKNELL2 on GEnie. refer a new data type like needn't hide anything from gain access to another class's<br />
COMPLEX (say, made up of<br />
<strong>Forth</strong> Dimensions 23 January 1992 February