[ 
http://issues.apache.org/jira/browse/JAMES-488?page=comments#action_12378729 ] 

Stefano Bagnara commented on JAMES-488:
---------------------------------------

Imho this is a good refactorring because it promotes the programming to 
interfaces in place of static access to hardcoded implementations.

This refactoring encapsulate the dnsjava usage in the DNSServer component, 
removing that dependency from the rest of James.

IMho there is an important distinction to be made: we have 2 classed named 
DNSServer: one is an interface in the org.apache.james.services.DNSServer, the 
other is an implementation of that interface and is 
org.apache.james.dnsserver.DNSServer.

IN summary the difference is that now the DNSServer implementation (and dnsjava 
for transitive dependencies) is a dependency of MOST of James, while after the 
refactoring the dependency on dnsjava is limited to the DNSServer 
implementation.

We talked about 2 different solution to the current "bad" usage of DNSServer 
implementation around the code:
1) use the java.net classes and add the sun properties to use dnsjava as the 
provider
2) use the DNSServer interface as a dependency (dependency injection, 
programming to interfaces).


Hope that this explains what the scenario is.


> Remove static access of DNSServer
> ---------------------------------
>
>          Key: JAMES-488
>          URL: http://issues.apache.org/jira/browse/JAMES-488
>      Project: James
>         Type: Improvement

>   Components: DNSServer
>     Reporter: Norman Maurer
>     Assignee: Norman Maurer
>  Attachments: DNSServer-non-static-usage2.patch, 
> DNSServer-not-static-usage.patch
>
> We should remove all static access to DNSServer and move the methods to the 
> DNSServer interface. After that we should be able to acces this via the 
> interface Serviceable. 
> This will it make easier to write junit tests etc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to