I started a geometry library in OpenJCV (the open java computer vision library, don't forget), to aid primarily in drawing shapes over images and streaming video. Initially, I created each class (point, line, ellipse, rectangle, etc) from scratch, using Java generics to allow for int, float, or double primitives.
However, the Java SDK provides implementations of some shape classes in the java.awt.geom.* package. For example, java.awt.geom.Line2D is an abstract class with implementations Line2D.Double and Line2D.Float. Are these worth extending? For now, I'm going to bet on 'yes'. It's a tough choice because I have no design reason for one way over the other. Also, I found no strong opinions about the subject anywhere Google can take me.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment