Stefan Ram wrote:
> PointGetter
> The interface with »get« methods.
> »Point« means a »time point«.
> I hope that in English, »point« can also
> mean »instant«.
You can use "point" to mean a point in time, but it's not very idiomatic. That
usage is pretty much restricted to a handful of special cases.
Also PointGetter is not (IMO) a good name (even conceding "point"). A "point
getter" is something that gets points. I'd expect it to have methods like
numberOfPointsAvailable()
getNextPoint()
findPointNearest(int x, int y)
and that kind of thing.
I suggest ReadablePoint (or GettablePoint) if you must build this algebra of
interfaces.
> PointSetter
> The interface with »set« methods.
WritablePoint (or SettablePoint). The things don't set points.
> PointCore
> The combination of PointGetter and PointSetter.
MutablePoint or just Point depending on whether this is the most-used
interface.
> Should I rename this to »PointBean«?
Absolutely not! Ugh!
> The »core« reflects the pure »data interface«
> without other operations. It kind of resembles
> a C structure and thus is not very object-oriented.
Which indicates a problem in the design, I think. What are the
/responsibilities/ you are trying to capture ?
> PointConversions
> Operations to convert the point to data
> types like »double«.
What is this for ? Are you trying to do Mixins in Java ? That will not work
(much though I like Mixins). Mixins are a technology for reusing
/implementation/, allowing code to be shared between otherwise independent
classes. Java interfaces are about typing and contracts, there is no
connection. When would you ever want to declare a variable
PointConversions x = // ...whatever
and what sensible name would you give to 'x' ?
> PointArithmetics
> Operations to add seconds to a point and so.
As above.
> Point
> Combination of all above interfaces.
OK, but you already have six interfaces with no (at least to me) obvious
justification for more than two.
> Java
> Well, admittedly a strange interface name.
> It contains Java-specific operations like
> conversion to a J2SE specific time value.
This could be defensible. Depends on how much infrastructure code needs to be
able to access pretty-much any of your domain objects without caring about
their type other than that they /are/ domain objects. I'm not sure I'd choose
"Java" as a name though.
> JavaPointCore
> PointCore + Java
See above.
> JavaPoint
> All of the above
Do you really expect the code that uses these objects to declare variables,
parameter types, etc, as JavaPoints ? Doesn't the weird name make your
design instinct cry "Fowl!" ?
> Is this over-engineered?
Yep
/Eight/ interfaces!
Even in the extreme case I can't see any value in more complexity than:
interface ReadablePoint {...}
interface MutablePoint extends ReadablePoint {...}
interface Persistable {...} // for the infrastructure stuff
abstract class PointAbstract
implements MutablePoint
{
// useful template for Point implementations
}
class DomainPoint
extends PointAbstract
implements Persistable
{
}
And even that is getting well on its way towards becoming unmanagable (though
it might have to /be/ managed).
-- chris