1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Spring interview questions

!!! Spring interview questions !!!

What are the benefits of IOC - Inversion of control (Dependency Injection)?

*Loose coupling: Components can added Declaratively so we can add and remove the components with out code change.
For Example :
<bean id="createCreditCard" class="springexample.creditcardaccount.CreateCreditCardAccount">
        <property name="emailInterface">
            <ref bean="email" />
        <property name="smsInterface">
            <ref bean="sms" />
        <property name="daoInterface">
            <ref bean="dao" />

There are three components associated with createCreditCard.
Tommorow you don't want smsInterface so just remove the xml configuration.
        <property name="smsInterface">
            <ref bean="sms" />

*Not Required any singletons : Don't need to code for singleton class. Every class is by default singleton. you can make not singleton
by making singleton="false"
<bean id="sms" class="springexample.sms.SMS" singleton="false">

*Objects are created Lazily .

*Initialization of properties is easy ? no need to read from properties file.
For Example:
<bean id="email" class="springexample.email.Email" >
        <property name="smtpHost">
IOC Contained set the setter method of Email class. setSmtpHost(). You don't nned to read from properties file with extra coding.

*No App Server Dependent ? like EJB JNDI Calls

Reviews and Comments

PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016

About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy