The flow.trac
model is separated into three packages, which are shown in the following figure. The classes in the project, flow.trace.core
, are independent of Spring Web Flow 2.
The classes defined in flow.trac.core
are listed here.
Each element, which can be stored into a database, is of type Item
, is a simple marker interface.
An Item
has some meta information which is enumerated as follows:
Additionally, the interface Item
extends the marker interface, java.io.Serializable
.
There are users inside a bug tracker system. In our case, the users are represented as an instance from flowtrac.core.model.User
.
For the User
instance, it is worth mentioning that our examples use the name of the user as the identifier. Therefore, the username is unique in our examples.
Each user has a role of type, flowtrac.core.model.user.Role
. At the time of first contact with the system (the login mask) each user possesses the role, Anonymous
. The role itself is modeled as an enumeration
type. We have implemented the following five roles:
After a user is logged in, the role of the user changes to a NamedUser
. Inside the bug tracker, an issue belongs to a project. The project is realized as an interface from the type, flowtrace.core.model.Project
. The interface Project
extends from flowtrac.core.model.Item
.
The central element of the system is of the type Issue
. This element contains all information about a bug or a requirement. The Issue
is annotated with elements from the JPA (Java Persistence API) to store it into a relational database.
In the following listing, we show the complete implementation of the class flowtrac.core.model.issue.Issue
.
package flowtrac.core.model.issue; flow.trac.core, flow.trac modelflowtrac.core.model.issue.Issue class, implementingimport java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import flowtrac.core.model.Item; import flowtrac.core.model.user.User; @Entity public class Issue implements Item { /** * Generated by eclipse. */ private static final long serialVersionUID = 5711325923341961421L; private String name; private String description; private Long id; private Date fixingDate; private Date lastModifed; private Date creationDate; /** * @see flowtrac.core.model.issue.Issue#getFixingDate() */ public Date getFixingDate() { return this.fixingDate; } /** flow.trac.core, flow.trac modelflowtrac.core.model.issue.Issue class, implementing* @see flowtrac.core.model.issue.Issue#getId() */ @Id @GeneratedValue public Long getId() { return this.id; } /** * @see flowtrac.core.model.issue.Issue#getName() */ public String getName() { return this.name; } /** * @see flowtrac.core.model.issue.Issue#setName(java.lang.String) */ public void setName(String name) { this.name = name; } /** * @see flowtrac.core.model.issue.Issue#setId(long) */ public void setId(long id) { this.id = id; } /** * @see flowtrac.core.model.issue.Issue#setFixingDate(java.util.Date) */ public void setFixingDate(Date fixingDate) { this.fixingDate = fixingDate; } /* (non-Javadoc) * @see flowtrac.core.model.issue.ItemInformation#getCreatedBy() */ public User getCreatedBy() { // TODO Auto-generated method stub return null; } /** * @see flowtrac.core.model.issue.ItemInformation#getCreationDate() */ public Date getCreationDate() { return this.creationDate; } /** flow.trac.core, flow.trac modelflowtrac.core.model.issue.Issue class, implementing* @see flowtrac.core.model.issue.ItemInformation#getLastModified() */ public Date getLastModified() { return this.lastModifed; } /* (non-Javadoc) * @see flowtrac.core.model.issue .ItemInformation#getLastModifiedBy() */ public User getLastModifiedBy() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see flowtrac.core.model.issue.ItemInformation#setCreatedBy( flowtrac.core.model.user.User) */ public void setCreatedBy(User createdBy) { // TODO Auto-generated method stub } /** * @see flowtrac.core.model.issue. ItemInformation#setCreationDate(java.util.Date) */ public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } /** * @see flowtrac.core.model.issue. ItemInformation#setLastModified(java.util.Date) */ public void setLastModified(Date lastModified) { this.lastModifed = lastModified; } /* (non-Javadoc) flow.trac.core, flow.trac modelflowtrac.core.model.issue.Issue class, implementing* @see flowtrac.core.model.issue. ItemInformation#setLastModifiedBy(flowtrac.core.model.user.User) */ public void setLastModifiedBy(User lastModfiedBy) { // TODO Auto-generated method stub } /** * @see flowtrac.core.model.issue.Issue#getDescription() */ public String getDescription() { return this.description; } /** * @see flowtrac.core.model.issue. Issue#setDescription(java.lang.String) */ public void setDescription(final String description) { this.description = description; } private Type type; /** * @return type type of the issue. */ public Type getType() { return this.type; } public void setType(final Type type) { this.type = type; } }
An issue can have a Type
. The type is encapsulated as enumeration
. Currently, we have implemented the following three types:
Each issue has a priority. The priority is encapsulated as enumeration
. We have implemented the following three priorities: