RE: what's rule for using @Component and xml bean file

2013-02-14 Thread Frank Zhang
> > Sent: Wednesday, February 13, 2013 2:12 PM > > To: Frank Zhang; Edison Su; Darren Shepherd > > Cc: cloudstack-dev@incubator.apache.org > > Subject: Re: what's rule for using @Component and xml bean file > > > > Okay, I was sold by XML now, since it is more i

RE: what's rule for using @Component and xml bean file

2013-02-13 Thread Alex Huang
Wednesday, February 13, 2013 2:12 PM > To: Frank Zhang; Edison Su; Darren Shepherd > Cc: cloudstack-dev@incubator.apache.org > Subject: Re: what's rule for using @Component and xml bean file > > Okay, I was sold by XML now, since it is more important to reduce > confusion

Re: what's rule for using @Component and xml bean file

2013-02-13 Thread Kelven Yang
s of power of XML, though it's more handy >in some >way (to me it's unit test which I think we could adopt javaConfig in >some extent). > >Anther strong reason is avoiding re-compiling when we make some change in >Spring configuration. Actually I would suggest us adopti

RE: what's rule for using @Component and xml bean file

2013-02-12 Thread Frank Zhang
code" in any design, this would make our project stronger , more flexible, and more modular. For example, to disable a component in customer environment for debug purpose, with XML file it's a single line change, with JavaConfig you have to re-compile and deliver some jar file, and binary ja

Re: what's rule for using @Component and xml bean file

2013-02-12 Thread Kelven Yang
on, this is to solve the slow bootstrap issue. -Kelven > >> -----Original Message- >> From: Edison Su >> Sent: Tuesday, February 12, 2013 9:44 AM >> To: Kelven Yang; Frank Zhang; Darren Shepherd >> Cc: cloudstack-dev@incubator.apache.org >> Subject: RE: what's rul

RE: what's rule for using @Component and xml bean file

2013-02-12 Thread Frank Zhang
pages official manual), I will never switch to another editor anymore. > -Original Message- > From: Edison Su > Sent: Tuesday, February 12, 2013 9:44 AM > To: Kelven Yang; Frank Zhang; Darren Shepherd > Cc: cloudstack-dev@incubator.apache.org > Subject: RE: what's r

RE: what's rule for using @Component and xml bean file

2013-02-12 Thread Edison Su
ren Shepherd > Cc: cloudstack-dev@incubator.apache.org > Subject: Re: what's rule for using @Component and xml bean file > > > > On 2/11/13 11:39 AM, "Frank Zhang" wrote: > > >Ok. now I understood the story. I will go XML for my components. > >I

Re: what's rule for using @Component and xml bean file

2013-02-11 Thread Kelven Yang
e to hear more developers to comment about it. -Kelven > >> -----Original Message- >> From: Kelven Yang >> Sent: Monday, February 11, 2013 10:48 AM >> To: Darren Shepherd >> Cc: Frank Zhang; cloudstack-dev@incubator.apache.org >> Subject: Re: what's r

RE: what's rule for using @Component and xml bean file

2013-02-11 Thread Frank Zhang
ee we should be POJO, but just avoid being purist if the gain is small. > -Original Message- > From: Kelven Yang > Sent: Monday, February 11, 2013 10:48 AM > To: Darren Shepherd > Cc: Frank Zhang; cloudstack-dev@incubator.apache.org > Subject: Re: what's rule for usin

Re: what's rule for using @Component and xml bean file

2013-02-11 Thread Kelven Yang
On 2/9/13 6:54 AM, "Darren Shepherd" wrote: >Sorry, technical error in sending the last email... > > >Please, please, please do note use spring packages. Spring should be a >runtime and not compile time dependency. If you leave spring as a >compile time dependency you'll see overtime that devel

Re: what's rule for using @Component and xml bean file

2013-02-09 Thread Darren Shepherd
Sorry, technical error in sending the last email... Please, please, please do note use spring packages. Spring should be a runtime and not compile time dependency. If you leave spring as a compile time dependency you'll see overtime that developers start leveraging handy spring utilities and comp

Re: what's rule for using @Component and xml bean file

2013-02-09 Thread Darren Shepherd
Please, please, please do note use spring packages. Spring should be a runtime and not compile time dependency. If you leave spring as a compile time dependency you'll ate On Feb 9, 2013, at 12:05 AM, Kelven Yang wrote: > > Apologize for such a long email first, if you are interested, plea

Re: what's rule for using @Component and xml bean file

2013-02-08 Thread Kelven Yang
Apologize for such a long email first, if you are interested, please read on... Auto-scan globally is never a good idea and we are currently doing it just for the reason of getting existing code quickly converted. I'm currently profiling some details on how much time Spring has spent for scanning

RE: what's rule for using @Component and xml bean file

2013-02-08 Thread Darren Shepherd
Frank, This is probably not the answer you looking for, but I have to just throw in my two cents. When should you use @Component? Never. The cleanest way to use the Spring container is to *never* "import org.springframework". Only bootstrap and obviously spring specific code should import spri

Re: what's rule for using @Component and xml bean file

2013-02-08 Thread Rohit Yadav
So, the rule of thumb is that if you want to give the sysadmin an option to disable a component (like a plugin for example), you define that bean (name, class map) in a context xml file, else you use the @Component annotation on the class (generally an impl) so spring creates a singleton/bean and a