Tuesday, September 30, 2008

Use Case Diagram















Here it is at long last. This use case diagram demonstrates the most basic of the functionality of the framework. We have determined that any scenario using our framework or any sub-functionality of our framework can be boiled down to a sequence of these events. For example, if an application wished to get all of the pieces of art near a point, it could send the point and a specified distance, and the framework would return all municipal data objects within that distance of that point. If the application wanted to expand this functionality, it could invoke this functionality for a series of points along a route. If we determine that this route proximity functionality is of great need, we could even implement functionality into our framework that takes a list of points and finds all MDOs in proximity to any point in that list. In the end however, this simply boils down to retrieving MDOs based on attribute criteria, the second use case.

Using Maven with Hibernate Annotations

We've decided to use purely Maven2 and have created a step-by-step tutorial to do so. The tutorial covers both Netbeans and Eclipse, using their respective Maven plugins.

Here is the video link.

The tutorial is as follows.

  1. Install the maven2 plugin for netbeans


  2. create the maven project using the following command.
    • mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=edu.wpi.hibernate.test -DartifactId=HibernateTestApp


  3. Import the project into NetBeans
  4. Add the maven compiler plugin by following the directions on their website here.
  5. Add the following dependencies in this order (groupId, artifactID, version)
    • (org.hibernate, hibernate, 3.2.6.ga)
    • (org.hibernate, hibernate-annotations, 3.3.1.GA)
    • (mysql, mysql-connector-java, 5.1.6) [This may vary depending on which DB you choose]
  6. Create the hibernate.cfg.xml file in "src/main/resources" with the follwing...
    • Change the following symbols { and } to <>

    • {hibernate-configuration}
      {session-factory}
      {property name="connection.url"}jdbc:mysql://hobonator/hibernate{/property}
      {property name="connection.username"}root{/property}
      {property name="connection.password"}root{/property}
      {property name="connection.driver_class"}com.mysql.jdbc.Driver{/property}
      {property name="dialect"}org.hibernate.dialect.MySQLDialect{/property}

      {property name="show_sql"}true{/property}

      {property name="format_sql"}true{/property}
      {property name="hbm2ddl.auto"}create{/property}

      {!-- JDBC connection pool (use the built-in) --}
      {property name="connection.pool_size"}1{/property}
      {property name="current_session_context_class"}thread{/property}

      {/session-factory}
  7. Change the connections settings to your MySQL server settings
  8. Add HibernateUtil class like the one shown in the Hibernate tutorial here
  9. Add a class with Hibernate Annotations
  10. Add a inside the node in hibernate.cfg.xml
  11. Run the project, you should see the table and rows have been created in your mySQL DB.
  12. Run "mvn eclipse:eclipse" in your project folder (assuming that you have maven2 installed correctly in your commandline)
  13. Install the eclipse maven plugin from here
  14. Import the project with eclipse
  15. Run the project with eclipse

Monday, September 29, 2008

Getting Maven Tasks for Ant

Maven tasks for Ant seems pretty easy to set up. First, make sure you have Ant and Java installed correctly (with Ant added to the path and ANT_HOME defined). Then, simply download Maven tasks for Ant on the front page of http://www.maven.apache.org/ (it's on the right side). Download the .jar version and drop that in the lib directory of your Ant install. From there on in, simply use a Maven build file to specify any dependencies (including hibernate, hibernate annotations, hsqldb and whatever else we will need).

Examples from the hibernate book that Prof. Pollice let us borrow can be found here: http://examples.oreilly.com/9780596517724/

Chapter 7 has the annotations example plus a Maven build file that has all of the dependencies.

Meeting September 26th, 2008

We met with Professor Pollice today, and discussed some sequences and scenarios that we thought would be applicable to our framework (presented from this document that we prepared yesterday). We decided that for the next week, we will attempt to come up with some more specific framework sequences, and to get hibernate implemented. We have been having trouble thus far trying to get Maven and Hibernate working as planned.

Wednesday, September 24, 2008

Meeting September 23rd, 2008

Today, we met in the ADP lab and worked more on Hibernation annotations in our NetBeans project. The project will be put up on SVN once our repository is approved. We also plan on getting the Use Case document ready and sent out for Friday soon.

Monday, September 22, 2008

Today's Redfish Meeting

Today, we met with Steve from RedFish. We talked with him about what we plan to have our framework do, and whether or not it overlaps with what he is doing. He talked with us about using agent vs. object-oriented programming and then we talked about what sort of use cases should be provided for our framework. He showed us several simulation that his company developed. Some may have been out of the boundary of our framework, but others gave us some ideas of other applications we should keep in mind while designing use cases.

Meeting September 22nd, 2008

Today, before meeting with Steve from RedFish, we discussed what we need to complete by Friday's meeting. We plan to get together tonight to put together a document with use cases and everything we talked about last Friday.