|
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of David Gibbs Sent: Tuesday, May 06, 2003 1:38 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: what is object oriented programming >> Do you agree that an object is a "thing" that is accessed only thru >>exposed >> interfaces? That no access to the internal components of the object, by >> definition, is allowed? >An object is a THING that encapsulates both data & methods to operate on >that data. >A data structure is simply an area of memory that has been given a specific >format. There is no means for code to be attached to a data structure. Consider an rpg compiler pre processor whose use is enforced by the DP mgr via the indomitable security of the iSeries. The pre processor scans the RPG code for any direct references to the subfields of data structures which are declared LIKEDS a predefined set of data structs. d Tp_Order ds qualified d CustNbr 7a d OrdNbr 7a d OrdQty 7p 0 d Orders1 ds likeds(Tp_Order) Any such references have to occur in procs which start with the nickname of the template and receive the data struct by reference as the first parm. /free orders1.OrdNbr = 'abc' ; // pre processor error! Order_AssignOrdNbr( orders1: 'abc' ) ; // thats OO! p Order_AssignOrdNbr b d Order_AssignOrdNbr pi d InOrder likeds(Tp_Order) d InOrdNbr 7a value /free InOrder.OrdNbr = InOrdNbr ; // pre processor says ok. return ; /end-free p e Wouldnt those RPG data structures then be considered objects? -Steve
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.