IObjectFactory

Allows the implementation of object factories used to create application context objects.

Namespace:
Inetdev.Context
Type:
Interface
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
Yes
Implements:
System.IDisposable

Properties

Name

Get or set the name of the Object Factory.

Signature:
public String Name { get; }

Methods

ContainsObject

Finds out if the Object Factory contains a definition for an object of the given name.

Signature:
public Boolean ContainsObject(name)
Returns

true if the Factory contains the object.

Parameters
Name Type Summary
name String The name of the object to verify.

ContainsObject

Finds out if the Object Factory contains a definition for an object of the given System.Type.

Signature:
public Boolean ContainsObject(objectType)
Returns

true if the Factory contains the object.

Parameters
Name Type Summary
objectType Type The System.Type of the object to verify.

GetObject

Retrieves an initialized instance of the object for the given type .

Signature:
public GetObject<T>()

GetObject

Retrieves an initialized instance of the object for the given type .

Signature:
public GetObject<T>(args)
Parameters
Name Type Summary
args Object[] Constructor arguments.

GetObject

Retrieves an initialized instance of the object for the given name.

Signature:
public Object GetObject(name)
Returns

The context object.

Parameters
Name Type Summary
name String The name of the object to retrieve.

GetObject

Retrieves an initialized instance of the object for the given name.

Signature:
public Object GetObject(name, thrown)
Returns

The context object or null if there was an error.

Parameters
Name Type Summary
name String The name of the object to retrive.
thrown Boolean true if an exception should be thrown or false if null should be returned when there is an error on creating the object.

GetObject

Retrieves an initialized instance of the object for the given name, passing the arguments to the object constructor

Signature:
public Object GetObject(name, args)
Returns

The context object.

Parameters
Name Type Summary
name String The name of the object to retrive.
args Object[] The arguments to pass.

GetObject

Retrieves an initialized instance of the object for the given name and type.

Signature:
public Object GetObject(name, requiredType)
Returns

The context object.

Parameters
Name Type Summary
name String The name of the object to retrieve.
requiredType Type The required Type of the object.

GetObject

Retrieves an initialized instance of the first object of objectType type.

Signature:
public Object GetObject(objectType)
Parameters
Name Type Summary
objectType Type The exact type of the object to retrive.

GetObject

Retrieves an initialized instance of the first object of objectType type.

Signature:
public Object GetObject(objectType, args)
Parameters
Name Type Summary
objectType Type The exact type of the object to retrive.
args Object[] Constructor arguments

GetObjectsOfContextAssignableFrom

Retrieves a list of initialized context object that are assignable from type .

Signature:
public IEnumerable GetObjectsOfContextAssignableFrom<T>()
Returns

A list of objects assignable from type .

GetObjectsOfContextAssignableFrom

Retrieves a list of initialized context object that are assignable from type type.

Signature:
public IEnumerable<Object> GetObjectsOfContextAssignableFrom(type)
Returns

A list of objects assignable from type.

Parameters
Name Type Summary
type Type The type that the objects are asignable from.

GetType

Retrives the Type of the object for the given name.

Signature:
public Type GetType(name)
Returns

The Type of the object.

Parameters
Name Type Summary
name String The name of the object to get its Type.

InjectDependencies

Inject into the object o the dependencies of an object named name.

Signature:
public Void InjectDependencies(name, o)
Parameters
Name Type Summary
name String The name of the object to get it's dependencies.
o Object The object where to inject the dependencies.

IsSingleton

Finds out if the object of the given name is a singleton.

Signature:
public Boolean IsSingleton(name)
Returns

true is the object is a singleton or false otherwise.

Parameters
Name Type Summary
name String The name of the object to verify.