I have to say, software development would be absolutely dire from my point of view without one particular generic type: Hash<T, K>. That really would destroy nearly every class I have ever written!
- thomas On 22/03/2012 01:47, Shinji KOBAYASHI wrote: > 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 > _______________________________________________ > openEHR-technical mailing list > openEHR-technical at lists.openehr.org > http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org > -- Ocean Informatics *Thomas Beale Chief Technology Officer, Ocean Informatics <http://www.oceaninformatics.com/>* Chair Architectural Review Board, /open/EHR Foundation <http://www.openehr.org/> Honorary Research Fellow, University College London <http://www.chime.ucl.ac.uk/> Chartered IT Professional Fellow, BCS, British Computer Society <http://www.bcs.org.uk/> Health IT blog <http://www.wolandscat.net/> * * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20120322/282651c9/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: ocean_full_small.jpg Type: image/jpeg Size: 5828 bytes Desc: not available URL: <http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20120322/282651c9/attachment.jpg>