Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Biology and Objects

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wanted to comment on how background affects the way you approach objects.

My interest in ecology and ecological modeling made it very easy to pick up computing with objects. Biology is full of hierarchical concepts and object orientation in ecological simulation is a good fit. Of course, Simula, the first object oriented language was created for simulation of complex systems.

Bill
 
Matt Weisfeld
author
Greenhorn
Posts: 24
5
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find it really powerful to use biological examples when I am developing content for educational purposes. People seem to remember programming concepts when using examples like these.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting.

William or Matt, could you give an example?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howard T. Odum had a major influence on ecological system simulation with his energy flow diagramming.

Entities in these diagrams illustrate OOP principles - they hide the internal details and provide specified inputs and outputs. Furthermore, and relevant to OOP in general, an Odum diagram provides something you can point to and explain when discussing the system to non-ecologists (non-programmers). We used them in environmental impact studies for that very reason.

Bill
 
Matt Weisfeld
author
Greenhorn
Posts: 24
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure that this is exactly what you are looking for, but you can use a hierarchy of birds. When you ask people to describe the most common behavior of birds almost everyone would say 'flight". However, not all birds fly. So you would have to decide if you want to create a Bird class that doesn't include a "flight" method. Perhaps you would need 2 classes, FlyingBirds and FlightLessBirds that inherits from the Bird class. There really is no right or wrong way to handle the design - it just makes for interesting discussions. Not all dogs can bark either.
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt Weisfeld wrote:Not all dogs can bark either.


Some goats scream like humans... it's freaky funny. Seriously though, while relating real-world concepts to OO designs can produce some very natural relationships, there are also pitfalls that you need to avoid. The classic example being A Square is not a Rectangle. I saw that there are sections in the book about Composition and Inheritance and how Inheritance weakens encapsulation.
 
r collins
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tree of life keeps getting restructured/reorganized as scientists discover new relationships between organisms and move the leaves and branches around. A class-based OOP approach is not as flexible in this case. Perhaps the prototype-based OOP approach is more suited in this case?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic