What's your best practice when changing value object classes?
Consider:
myservice-api-1.0.0.jar
META-INF/MANIFEST.MF
Export-Package: myservice;version="1.0"
public interface MyService {
void doStuffWithValue(MyValue v) ...
MyValue returnValue() ...
}
public class MyValue {
String member1;
int member2;
public boolean equals(Object obj) ...
public int hashCode() ...
}
myservice-impl-1.0.0.jar
class MyServiceImpl implements MyService {
...
}
Now if I need to update the implementation of MyValue's
hashCode method, what would you do?
- not update API version
- update API version
- wrong design, use a factory pattern for MyValue
- wrong question, you should avoid value objects altogether
- <other suggestions>
Thanks
Mike Wilson
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev