Hi Rob,

Indeed the question i had in mind while posting
was "should i care about IoC while developping in Perl ?".
Your answer seems to be *no*.
Then how can i argue to my friends that
"IoC is not often a good way to write stuff".
Have you some examples ?

Jos�.


-----Original Message-----
From: Rob Dixon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2003 11:51 AM
To: [EMAIL PROTECTED]
Subject: Re: What is Inversion of Control (IoC)


Nyimi Jose wrote:
>
> More and more my fellow Java's friends tell me about IoC. What is IoC 
> in Perl world ? Examples ?
>
> Here are some links about IoC a friend gave to me : 
> http://picocontainer.org/ioc.html 
> http://jakarta.apache-korea.org/avalon/framework/guide-patterns-ioc.ht
> ml
> http://www.springframework.org/docs/lightweight_container.html
> http://javangelist.snipsnap.org/space/IoC

Hi Jos�.

This pairs nicely with Kevin's question about callbacks, because that's essentially 
what IoC is. In the classic model the code know all about the structure of the program 
as a whole and where to find the functions it needs. You will code your Perl program 
to call a particular member function from a specific package.

In IoC your code only needs to declare what it's able to do
and the lower-level software will decide when to call it.

In Joseph's 'sort' example in the 'What is a callback' thread the compare function 
just sets itself up, saying 'I can tell you which order a pair of values should be 
in'. It then sits back and waits to be summoned.

Another obvious IoC situation is in Windows programming, where the program is 
effectively just a fixed set of subroutines that Windows needs to call at the 
appropriate time.

But don't go trying to write code using IoC just because somebody's recently thought 
of a name for it. The idea's been around a long time and it isn't often a good way to 
write stuff.

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to