Re: What is Inversion of Control (IoC)

2003-11-24 Thread Rob Dixon
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.html
 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]



RE: What is Inversion of Control (IoC)

2003-11-24 Thread NYIMI Jose (BMB)
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]



Re: What is Inversion of Control (IoC)

2003-11-24 Thread James Edward Gray II
On Nov 24, 2003, at 5:08 AM, NYIMI Jose (BMB) wrote:

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*.
I think you're over generalizing here.  First, this isn't a Perl issue, 
specifically, you could ask the same question of any development tool.

The correct answer is probably just as general, Sure, you should care 
about IoC when it makes sense to and leave it at home the rest of the 
time.

Then how can i argue to my friends that
IoC is not often a good way to write stuff.
Have you some examples ?
Well, grab a book on Design Patterns and recommend some of the others.  
They all have their uses.

James

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


Re: What is Inversion of Control (IoC)

2003-11-24 Thread Rob Dixon
Nyimi Jose wrote:

 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 ?

As James says, it's not a language question: Perl can do
callbacks too! But it's never a good idea to program according
to this month's buzzword. It's an advanced decision to choose
IoC over normal threaded code. Ask your friends where they would
use it and how and, when they burble, just understand that
they've simply hit on a fad.

Rob



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



RE: What is Inversion of Control (IoC)

2003-11-24 Thread NYIMI Jose (BMB)
rob
Ask your friends where they would use it and how and,
when they burble, just understand that they've simply hit on a fad.
/rob

Yes! I will do :-)

José.

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


Nyimi Jose wrote:

 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 ?

As James says, it's not a language question: Perl can do callbacks too! But it's never 
a good idea to program according to this month's buzzword. It's an advanced decision 
to choose IoC over normal threaded code. 

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]