Hi Peter, 2012/3/22 Peter Gummer <peter.gummer at oceaninformatics.com>: > Shinji KOBAYASHI wrote: > >> Ruby implementation might be one of the proof for replace of generics. >> I had much struggled to implement generics and got the conclusion >> that we do not need it. > Ruby doesn't have generics at all, right, Shinji?
It is right. I felt generics is very convenient, when I used Java, such as Iterator<DvText> it = someRmArrayInstance.iterator() But I found it must be cut off by 'Occam's razor' in Ruby. it = some_rm_array.iterator This code looks curious for Java/Eiffel/C# user who are similar to generics, but it is enough for encapsulated object instance. I think this depends on language environment, but nested generics seems complicated codes for me. List <Map <Integer, String>> Generics is useful to declare what instance is, but it breaks encapsulation. As regards to Bartrand Meyer's paper, 'a good balance' is a good design. Cheers, Shinji > There's a comparison of generics and inheritance in an appendix of Bertrand > Meyer's "Object Oriented Software Construction", 2nd edition. > (http://se.ethz.ch/~meyer/publications/acm/geninh.pdf seems to be the > original paper that the appendix is based upon.) > > Generics can be simulated in a language with inheritance, but there is a cost: > * Duplication of code. > * Extra verbosity. > > I don't want to have either forced upon me. If I'm unfortunately forced to > use a language that doesn't support generics, then I can always simulate it > the generics with inheritance. But I certainly wouldn't want the specs to be > obfuscated by hacks like that, thanks very much ;-) > > Peter > _______________________________________________ > openEHR-technical mailing list > openEHR-technical at lists.openehr.org > http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

