![]() | |
#101
| |||
| |||
|
|
Using OO methodology, I could write a small class that exposed a read and write method as well as a property called Surname. The code for updating the property could simply always convert the surname to uppercase and the Write method could update the date updated flag automatically. Programmers would then not access the customer file directly but use this object using code such as : Customer=New CustomerClass Customer.Read(CustomerId) Customer.Surname="Smith" Customer.Write If I changed my mind as to the implementation of the class - perhaps I wanted to update the Surname field so that it didn't allow any spaces, this would be very easy to do using the OO method, but a lot messier in normal Databasic. |
#102
| |||
| |||
|
|
"Simon Verona" <nomail (AT) nomail (DOT) zzz> wrote in message news:44abbfd3$0$69370$ed2619ec (AT) ptn-nntp-reader01 (DOT) plus.net... Using OO methodology, I could write a small class that exposed a read and write method as well as a property called Surname. The code for updating the property could simply always convert the surname to uppercase and the Write method could update the date updated flag automatically. Programmers would then not access the customer file directly but use this object using code such as : Customer=New CustomerClass Customer.Read(CustomerId) Customer.Surname="Smith" Customer.Write If I changed my mind as to the implementation of the class - perhaps I wanted to update the Surname field so that it didn't allow any spaces, this would be very easy to do using the OO method, but a lot messier in normal Databasic. You said it above..."Programmers would then not access the customer file directly but use this object ", implying that it is possible to bypass the object strictures? If so, what is the difference between this and what I (and many others) have been saying "Programmers would then not access the customer file directly but use the given Read/Write subroutines". In both cases, it seems that the onus is on the programmer to follow orders, else she can do anything she wishes. Is this true? Further, in the case of tools like a web development front end, you'd never have any of the code above at all. It's all implied, and the data movement is automatic. Therefore, if the above uppercase rule were embedded in the Write subroutine (via, say, a dictionary definition), is this just as maintainable as above? And, as an aside, its amusing (insert emoticon here) to see so much disagreement on basic jargon in the last few posts. . Chandru Murthi It is obvious that the *end result* would be identical - in fact I |
#103
| |||
| |||
|
|
murthi wrote: "Simon Verona" <nomail (AT) nomail (DOT) zzz> wrote in message So, for example, using subroutines I can make the following mistake: MyCustomer="" CALL CUSTOMER_READ(MyCustomer,"123") .... .... .... CALL INVOICE_WRITE(MyCustomer,"456") I have written away a different customer than I had written... With the object notation, I could write code such as : Dim myCustomer as New Customer myCustomer.Read("123") ..... .... myCustomer.Write |
#104
| |||
| |||
|
|
Simon wrote: murthi wrote: "Simon Verona" <nomail (AT) nomail (DOT) zzz> wrote in message So, for example, using subroutines I can make the following mistake: MyCustomer="" CALL CUSTOMER_READ(MyCustomer,"123") .... .... .... CALL INVOICE_WRITE(MyCustomer,"456") I have written away a different customer than I had written... With the object notation, I could write code such as : Dim myCustomer as New Customer myCustomer.Read("123") ..... .... myCustomer.Write If the same programmer was writing the code, then I'd sggest that the final line could just as easily be mis-typed as : myInvoice.Write as the CALL INVOICE_WRITE(MyCustomer,"456") You have suggested. The difference of course is that a"real" OO compiler may pick up on he fact that the "myInvoice" object was never created. However, as the "Basic" I use doesnt support OO, the point is mute for most readers. I don't see any of the Basics we use today becoming "really OO" - we an simulate up to a VERY USEFUL point, either through extensions ala QM Basic, or smart pre-processors like the Snippet Technology and Object structure we make available with Visage, but we will not get the whole shooting match ... and formost readers it probably doesn't matter a great deal either way :-(E) |
#105
| |||
| |||
|
|
However, ... the point is mute [snip] |
#106
| |||
| |||
|
|
Ross Ferris wrote: [snip] However, ... the point is mute [snip] http://dictionary.reference.com/browse/mute http://dictionary.reference.com/browse/moot |
![]() |
| Thread Tools | |
| Display Modes | |
| |