the OO metaphor

Peter Andersson Peter.Andersson@REDACTED
Wed Nov 29 18:13:07 CET 2000


Hi Sean,

Darn, I should never have used the words 'any' or 'pure' - that's asking for
trouble! :)

It's more the nature of the problem itself and the model of a possible solution
to it, that points me in some sort of direction, I guess. I have no formal
criterias to use and I try to be objective and learn from my own and others
experience. I've heard motivations for using an object oriented model and
implementation for "any" type of problem because it gives you modularity,
encapsulated information, etc. I don't agree with this at all. I can achieve
most of these features with any language really, it's more a matter of
programming style. Ok, an OO model and implementation may force me to
encapsulate data and define clear relationships between my entities and
therefore help me produce robust and maintainable code. However, if I need to
twist a straightforward and intuitive model around to fit it into an OO model, I
think this only results in even bigger problems. Especially if I start defining
unintuitive inheritance relationships between classes just to avoid redefining
methods!

To model "real/fantasy world" objects and relations, I belive OO methods can be
very helpful. If I didn't need the concurrency features of my simulator system,
I would implement it in an OO language. Why? Because I use what very much looks
like an OO model to define the world I'm going to simulate and it feels more
intuitive to implement the system using a language with existing OO support
rather than to think up new Erlang constructs that enable e.g. class
inheritance.

This probably doesn't answer your question at all. I think someone with more
experience of working with OO modelling and implementation could give you more
relevant examples of when OO methology is the best to use. Someone once worked
hard on convincing me that design patterns was the most important thing that had
ever happened to the world of computing and that without OO languages, design
patterns could not be applied. I read a bit about these patterns and I thought
they were abstract enough to be applied to any model to be implemented by most
languages that have good modularity support.

  /Peter


Sean Hinde wrote:
> 
> Peter,
> 
> > Erlang for any type of concurrent implementation, but if the
> > problem is pure OO,
> 
> I'd be interested to see an example of what you consider to be a pure OO
> problem, or if not, what criteria you would apply to decide which would be
> the most appropriate methodology
> 
> Rgds,
> Sean
> 
> NOTICE AND DISCLAIMER:
> This email (including attachments) is confidential.  If you have received
> this email in error please notify the sender immediately and delete this
> email from your system without copying or disseminating it or placing any
> reliance upon its contents.  We cannot accept liability for any breaches of
> confidence arising through use of email.  Any opinions expressed in this
> email (including attachments) are those of the author and do not necessarily
> reflect our opinions.  We will not accept responsibility for any commitments
> made by our employees outside the scope of our business.  We do not warrant
> the accuracy or completeness of such information.



More information about the erlang-questions mailing list