Skip to content

SR Chapter1

April 12, 2010
tags: ,

DI for increasing decoupling

Service Locator pattern :

JNDI: Java Naming and Directory Interface

First I understand that is like a box where you put your objects in. And these can be searched based on attributes as well.
naming – means giving a name, an alias
binding – is the real entry or physical entity that is finally given the name or alias. it’s the “association”
an object reference has addresses of real objects.

Context – Set of bindings. To Get the address of the search point – could be the complete name of the object or also it’s root top level name. Like a HashMap.

o=sun,c=us : c=us top level context and o=sun is the sub context. (Context = Name:Object set)
Naming System: Similar contexts – example having the same naming convention – eg: ldap,dns etc.
Naming service – is the one who knows how to map names to objects/entries – real entities.

Directory : CRUD op’s provided for objects
Directory service: to help in searching – doing all op’s

The SPI provides methods that allow different provider implementations to cooperate to complete client JNDI operations.

LDAP – SPI – has a property for pooling : The default pooling criteria is that plain (non-SSL) connections that use simple or no authentication are allowed to be pooled. The pooling criteria can be adjusted to include SSL connections and the DIGEST-MD5 authentication type by using System properties. No other type of customization of the pooling criteria is supported. To allow SSL connections to be pooled, include the string “ssl” in the com.sun.jndi.ldap.connect.pool.protocol System property. For example, to allow both plain and SSL connections to be pooled, set this System property to the string “plain ssl”.

If the "com.sun.jndi.ldap.connect.pool.timeout" System property has been set, the LDAP provider will automatically close and remove pooled connections that have been idle for more than the specified period.

• Object factories—For transforming data stored in naming/directory services into Java types more natural to the Java application.
• State factories—For transforming objects of Java types natural to the program into formats suitable for storage into naming/directory services.
• Response control factories—For narrowing LDAP v3 response controls received from LDAP servers into more user-friendly types.

3 types of DI , setter , constructor and interface injection.
In interface in the methods – the parameter – passed is the map with all the components.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: