× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"Steve Richter" <srichter@xxxxxxxxxxxxx> wrote in
message news:PIEOLKFJABHFAMOFANGHIEBLDFAA.srichter@xxxxxxxxxxxxxxxx
>        orders1.OrdNbr = 'abc' ;                // pre processor error!
>        Order_AssignOrdNbr( orders1: 'abc' ) ;  // thats OO!

No, that's *NOT* OO ... that's just reasonably good procedural programming.
The DS orders1 does not encapsulate any of the code necessary to operate on
the data contained within it.  This is the key, in my experience, to OO
programming.

If I were to write something like that in Java it would go a bit like ...

Order orders1 = OrderNumberFactor.newOrder();
Customer cust1 = CustomerList.getCustomer('1234');
orders1.setCustomer(cust1);
orders1.setBillTo(cust1.getDefaultAddress());
Address shipToAddr = new Address("123 main st");
orders1.setShipTo(shipToAddr);
orders1.printAcknolegement();

Notice that the data within orders1 is never touched directly ... every
operation done to the data within orders1 is done through methods contained
within it.  My code does not KNOW nor does it CARE how the data in the
Orders object is stored.  If setting the billto updates the backend
datastore, so be it... my code doesn't care.

The only way for any procedure to do something to your orders data structure
is to retrieve the information directly from it.  Those procedures must know
specifically how the data is stored in the DS and must also handle any
updates to the datastore if it changes.

I'm not sure what pre-processor you are referring to here... but it sounds
like all it does is try and enforce standards (which isn't necessarily a bad
thing) ... but it certainly doesn't implement OO concepts.

david



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.