hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: services without setters
Date Wed, 25 Jan 2006 23:59:02 GMT
You also use setters in your unit tests to inject your dependencies.  Of
course, you can use constructor-based dependency injection in HiveMind to
avoid the setters.  Typically, the setters aren't exposed via the service
interface, so it's no big deal.  I personally like setter-based rather than
constructor-based, but that's really just a personal preference I guess.
Most IDEs these days will generate your setters for you.  But, it just makes
for more code to maintain.

-----Original Message-----
From: Jean-Yves Sironneau [] 
Sent: Wednesday, January 25, 2006 5:44 PM
Subject: services without setters


I think it can be interesting for hivemind to bypass setters for setting 
services properties, because in a lot of cases setters are just declared 
for hivemind to be able to
set a property but should not be used otherwise for example :

    public int getPublisherActivationPeriod() {
        return this.publisherActivationPeriod;

    public void setPublisherActivationPeriod(int 
publisherActivationPeriod) {
        this.publisherActivationPeriod = publisherActivationPeriod;

This would be possible to not have to declare the second method by 
bypassing  the  setters method  (if  the security  configuration of  
the  JVM  allow it).
Of course it's just in the implementations so it's just a verbosity 
issue, and a way to see what is "settable" and what is not. What do you 
think ?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message