well, quite!

To give an example, imagine you want to multiply a vector and a matrix...

Somewhere, you have to define that operation.

So is the ability to multiply by matrices a property of vectors?
Or is the ability to multiply by vectors a property of matrices?
You shouldn't do both, as that's pointless repetition, and not good
for maintenance
Or should you treat vectors as a degenerate case of matrices, which are able
to multiply by other matrices.
But then you accept that you'll be violating the LSP, because vectors aren't
matrices, not really.


Or... is the multiplication of vectors and matrices a first class function
in its own right? Dependent on both types but separate from them
Problem is, this sort of thing isn't really accepted in "classic" OO design,
where every operation has to be a member property of some type or another.

You may argue that vectors and matrices aren't real things, so I'm not
modelling the real world here and it therefore does't apply.
But the business processes so often represented by OO systems aren't "real"
either, and I'm sure I could think of an example relating to actual physical
objects if required.


On 15 July 2010 13:42, twitter.com/nfma <[email protected]>wrote:

> On 15 July 2010 14:35, Carl Jokl <[email protected]> wrote:
>
>> I might argue that in the case of Object Oriented programming, a big
>> aspect of making it natural to learn is the way it mimics the real
>> world.
>> Objects can be created which mimic real world objects. The ability to
>> identify an object with objects in real life helps make the concepts
>> more
>> natural once you see how it works.
>>
>
> I agree but what are Utility classes and FooManagers and similar?
> Isn't it that we need verbs in the language and lack a decent abstraction
> like a first class function?
>
>
>>
>> In the case of functional programming, I am not sure if there is a
>> real world analogy to draw upon. It is heavily inspired by mathematics
>> which isn't everybody's strongest suit. Granted
>> that plenty of maths exists in nature but still...
>>
>> I learned Haskell and Prolog in University and haven't used them
>> since.
>> I have long believed in trying to use the right tool for the job. I
>> think a hybrid is the best way forward.
>>
>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "The Java Posse" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<javaposse%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/javaposse?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>



-- 
Kevin Wright

mail/google talk: [email protected]
wave: [email protected]
skype: kev.lee.wright
twitter: @thecoda

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to