tags:

views:

126

answers:

1

I am teaching C# for Bioinformatics students. Just I started OOP Principles. I have to explain the terms again and again because they feel bore while I use technical term. Finally I decided to communicate them in their language (I mean giving example from Biological related term).

For me it is hard to coin the term class, object, event, delegates, attributes, polymorphism, inheritance, encapsulation, serialization, reflection, etc with biological related. If some one starts giving example of at least some terms, I can frame the rest.

+8  A: 

Such examples can be contrived and fail to ellicit the complete implications of OO programming. Students will get stuck on unrealistic uses of polymorphism and inheritance based on Dog Is-A Mammal.

One might view a class as a species, say and an object as an organism, but then what are static classes and static methods? Such metaphorical concepts should be discarded rather rapidly in their education, lest it cripple their usage of a language which is far richer than the metaphors to other fields of experience.

It is important to remember that although OO is useful for modelling the real world, it is also only an internal representation and there are sometimes needs where the software implementation will not have literal 1-1 correspondence with reality.

For instance, static factory methods Rabbit::CreateRabbit is not related to at all to the real world of making new rabbits - which is probably more like an instance method valid only on a female rabbit taking a male rabbit with a delegate callback which will fire 28 days later. If they get that joke, they're probably ready to graduate.

Cade Roux
Nice answer Cade! Yes, despite the fact that both OOD and the real world have objects I don't think that OO maps any better to the real world the functional or procedural languages might. By all means, make up metaphors but be cautions for when it is time to drop them. Do BioInformatics students really need that deep of an understanding of OO anyways?By the way Cade, weren't you in my recent talk on C# lambdas?
George Mauer
Yes, good talk. I had lunch with Peter last week and told him how impressed I was with your work.
Cade Roux