110 likes | 239 Views
update 1. TimeTracker 2, Take 1. Servlets. Web Interface ( jsp ). Servlet (business logic and processing). Form Submit. R/W. App Engine Datastore. TimeTracker 2, Take 1. Simple setup turns into “Spaghetti Code”. Web Interface ( jsp ). Servlet (business logic and processing). Form
E N D
TimeTracker 2, Take 1 • Servlets Web Interface(jsp) Servlet(business logic and processing) Form Submit R/W App Engine Datastore
TimeTracker 2, Take 1 • Simple setup turns into “Spaghetti Code” Web Interface(jsp) Servlet(business logic and processing) Form Submit 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 • 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 staticvoid archive(Date date, Integer page) { List<Article> articles = Articles.fromArchive(date, page);render(articles); } Play! uses the method parameter’s static type, to translate the HTTP value into a Java object. • Then, in our view, we can access the articles list of java Articleobjects 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> … 2 3 3.5 4
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