you couls use DAO Pattern to implement your LDAP Modules, look at this url : www.developer.com/java/ejb/print.php/3077421