Should I use structure from a core library graphic toolkit in my domain?

Posted by Laurent Bourgault-Roy on Programmers See other posts from Programmers or by Laurent Bourgault-Roy
Published on 2012-10-24T14:35:34Z Indexed on 2012/10/24 17:14 UTC
Read the original article Hit count: 296

Filed under:
|
|

In java (and many other programming language), there are often structure to deal with graphic element : Colour, Shape, etc. Those are most often in a UI toolkit and thus have a relatively strong coupling with UI element.

Now, in the domain of my application, we often deal with colour, shape, etc, to display statistic information on an element. Right now all we do with it is display/save those element with little or no behaviour. Would it make sense to avoid "reinventing the wheel" and directly use the structures in java.awt.* or should I make my own element and avoid a coupling to this toolkit? Its not like those element are going away anytime soon (they are part of the core java library after all), but at the same time it feel weird to import java.awt.* server side. I have no problem using java.util.List everywhere. Should I feel different about those class?

What would be the "recommended" practice in that case?

© Programmers or respective owner

Related posts about java

Related posts about domain-model