TimeTracker 2.0 - Marshall University

Download Report

Transcript TimeTracker 2.0 - Marshall University

update 1
TimeTracker 2, Take 1
 Servlets
Web Interface
(jsp)
Form
Submit
Servlet
(business logic and
processing)
R/W
App
Engine
Datastore
TimeTracker 2, Take 1
 Simple setup turns into “Spaghetti Code”
Web Interface
(jsp)
Form
Submit
Servlet
(business logic and
processing)
R/W
App
Engine
Datastore
Spaghetti Code Solution?
 MVC
 Model, View, Controller
http://www.pnp-software.com/eodisp/images/mvc-original.png
•model: stores the data and application logic for the interface
•view: renders the interface (usually to the screen)
•controller: responds to user input by modifying the model
Which MVC to Use?
 Must be:
 Be easy to use
 Compatible with Google App Engine
 Possibilities:
Spring Framework
 Which components?
 Spring Security
 Spring Webflow
 Spring Web Services
 Spring Roo
 Spring Integration
 Etc.
 Examples use old version
and can’t get examples to
work with new version
GWT MVC
 Would require a switch to
Google Web Toolkit for UI
 GWT complicated enough
without adding another
layer on top of it
Play! Framework
 Fairly new, but has
good support and
active developers
 Easy to use and setup
 Not easiest thing to
develop with because
requires you to use
terminal to deploy
 Can’t test Persistence
to Google App Engine
without Deploying
Play! Architecture
http://www.slideshare.net/areelsen/introduction-playframework
Play! Framework in Action
1.
1
2.
3.
2
Make a request from a browser
/articles/archive?date=08/01/08&page=2
Router file knows we want to call the function archive
in the Articles.java controller file.
archive function can retrieve the date and page values
by defining them as parameters to the function.
public static void archive(Date date,
Integer page) {
List<Article> articles =
Articles.fromArchive(date, page);
render(articles);
}
3
Play! uses the method parameter’s static type, to
translate the HTTP value into a Java object.
4.
4
3.5
Then, in our view, we can access the articles list of
java Article objects directly and display them to the
user.
...
<a
href="@{Article.show(article.id)}">
${article.title}</a>
Which generates the following HTML:
<a href="/articles/15">My new
article</a>
…
Project Status & Timeline
 Status: Behind
 Integrating MVC into the application architecture
 Inability to easily find an MVC that worked nicely with Google
App Engine
 Timeline
 Mid-November
 Solid understanding of Play! Architecture and its integration with
Google App Engine
 Basic Play! Application deployed and working on App Engine
 End of November
 Basic TimeTracker application functionality implemented
 Logging time
 Managing Employees, Projects, Clients, etc.
 Deployed to AppSpot
 End of Semester
 Began implementing new functionality