|
David Morris wrote: >I do agree that RPGIV is lacks many basic features of >an object oriented language. Primarily the interfaces >provided do not allow very much flexibility. You cannot >pass variable type parameters, and because of parameter >passing restrictions, you cannot simulate inheritance >directly. In order to support these things you have to >define your own storage system. RPGIV will do little to >help you understand OO, but I think it is a better >starting point than RPGIII. Agreed. What RPG IV offers over RPG III is better facilities for modular programming, and that's certainly one step on the road towards OO. >I am interested to find out how your experience with OO >programming progresses. We had problems when we >assumed that inheritance should be used wherever >possible. We ended up backing off quite a bit. I >suspect this has happened to others. Well, as part of my learning process, I'm currently working on a genealogy app in my spare time. This is another of my many interests, and since there are few genealogy apps that run on my chosen O/S, Linux, it also has a practical use. It's also a domain that lends itself nicely to OO design. I can relate to your experience regarding inheritance. It's tempting at first to use it everywhere, even where it's not appropriate. One nice thing about OO is that it really seems to force you to do things right. In particular, spending more time upfront in the design phase helps tremendously. When thinking about inheritance, you need to examine the relationships between your objects. These relationships generally are of two types: "IsA" and "HasA". For example, a dog "is an" animal, but a dog "has" four legs. This example is obvious, but in practice, other relationships may not be, especially when you're starting out. Experience is a good teacher. >I am no expert in Java and I am sure most of our problems >with OO have been caused by a lack of experience. I >have been working on a system that uses inheritance >extensively, and there were drawbacks. One problem >is that inheritance is defined at compile time. Another >problem, and the one caused the most problems for us >was that changes to a parent can affect subclasses. >A system built of components is generally more flexible, >the trade-off is that you do not get the same level of >re-use. I've been there too! Sometimes I really wish Java supported multiple inheritance. But then again, that would only encourage patchwork application designs (IMHO). I think OO is leading us to a level of software practice where we do what's right not because we're told to, but because we know it's right. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-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.