|
In a message dated Thu, 10 May 2001 14:40:44 -0500, "Bartell, Aaron L. (TC)" <ALBartell@taylorcorp.com> writes: > Exactly! Basically they are entirely different but they all have the same > name. Maybe the examples given here are bad examples but there is > definitely a place for overloading in RPG. Lets say I want to look up a > customer information record. Sometimes I only have the last name of the > customer, and sometimes I have the actual customer number, but I could call > #GetCustInfo with either the Last name or the customer number. i.e. > #GetCustInfo(LastName) or #GetCustInfo(CustNo). Do you see the advantage? No. Here I would definitely want #GetCustInfoNo(CustNo) and #GetCustInfoName(LastName) as different functions. They would use different access paths, one would just chain and return Yes/No the other would do a fuzzy soundex search and return a 'most likely to least likely' subfile to select from - TOTALLY different functionality for ENTIRELY different application. I would turn your assertion upside down and say this: 'If you have a function that you think it would make sense to overload, you have not done your functional decomposition right and have misnamed your function.' Properly named and designed functions are not tempting targets for overloading. It is only functions called DoWhatIMean(WhatIGiveYou) that lend themselves to that particular nightmare. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.