What is an Ioc pattern?
There are assemblies in .net for establishing this task,
Whats the special in Java /j2ee technologies about IOC

Answer Posted / imtiyaz

Yes i totally agree with the answer of janani,
Now lets dip to one more level

IoC pattern can be implemented in three ways: setter based,
constructor based, and interface based

Setter-Based IoC
This type of IoC uses a setter method to inject the
referenced object into a referring object. This is the most
common type of IoC, and both Spring and PicoContainer
implement it. Setter-based IoC is good for objects that
take optional parameters and objects that need to change
their properties many times during their lifecycles. Its
main disadvantage is that you need to expose all the
properties of an object to the outside world when using a
setter method. This breaks one of the key OO principles:
data encapsulation and information hiding.

Constructor-Based IoC
This type of IoC uses a constructor to set the reference of
the object. Its main advantage is that only the creator
knows about the referenced object. Once the object is
created, the client code that uses the object is unaware of
the referenced object. This approach may not work in all
types of applications, however. For example, if you use an
external API that needs a default constructor, then you
need to go with a setter-based IoC. A constructor-based IoC
is the main type of implementation in Spring.

Interface-Based IoC
In this type of IoC, objects implement a specific interface
from the IoC framework, which the IoC framework will use to
properly inject the objects. One of the main advantages of
this type is that it doesn't need an external configuration
file to configure the object references. Since you need to
use the IoC framework's marker interface, the IoC framework
knows how to glue the objects together. It is similar to
using EJB. Any EJB container knows how to instantiate your
objects and hook them with itself. The main disadvantage of
this approach is that the marker interface ties your
application to a specific IoC framework. Apache Avalon is
based on this approach but this project has been closed.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.

1687


please mail me the interview question based on java/j2ee

1623


What are the interfaces in java collections? : java collections

712


What is an algorithm in java collection framework? : java collections

679


who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.

1929






what is mean by hasing and maping in java platform and advantage?

1943


What are the different types of ways where you can iterate over a list? : java collections

656


What is the Spring2.5 MVC Navigation flow?

5542


How do I find jre path in windows?

607


Should we create system software ( e.g operating system ) in java ?

661


What do you understand by synchronization? Why is it important?

676


Which java collection class can be used to maintain the entries in the order in which they were last accessed?

659


What is the enumerator of the java collection framework? : java collections

661


What are the different types of features of the java collections framework? : java collections

672


Hi Friends , am newbie to ajax. For example just consider one account registration - A form contains 8 text fields with submit button. In this form second texbox contains "username " . On right side of text box there is a label box . On clilck action i need to determine user is available or not. Is it possible on clicking label or should i click submit button.

1691