slub.team team mailing list archive
-
slub.team team
-
Mailing list archive
-
Message #00434
Re: [Merge] lp:~zeutschel/goobi-production/extended-jersey-api into lp:goobi-production
> Btw, the compiler warning is issued because JAXB dissects classes by
> introspection that the compiler isn’t aware of. The annotations do turn into
> getter methods hidden from it. One can argue over wether that is a good
> design; but I don’t really think adding unused methods to a class that make
> use of its variables just to make the compiler not complain the variables are
> unused isn’t a good design, either.
Kind of a dilemma here. On the other hand, setters and getters are easy to understand and provide for testable design. Right now, these classes are only meaningful in a Jersey context.
>
> Second, arbitrary setter methods open the floodgates to misuse the respective
> classes. E.g. org.goobi.webapi.beans.Label was designed with an Enum type
> which has to be passed to its constructor and which results in that it is used
> with exactly one attribute. This is sensible: *Either* it can be used to label
> a fixed String value by a human readable label *or* to label a human readable
> String with its respective language. Other combinations are not intended.
> [...]
What's the use of this label class beside getting serialized to an XML attributes?
If so, why not just name it "AttributeMap"?
If we consider this AttributeMap just a DTO, some DAO is then responsible for making sure that there is no inconsistent state. Everything else is then a bug in the query protocol. The nice thing about POJOs is, that they can stand clear of complex domain logic.
--
https://code.launchpad.net/~zeutschel/goobi-production/extended-jersey-api/+merge/133922
Your team Saxon State Library Team is subscribed to branch lp:goobi-production.
References