150 likes | 295 Views
School Supply System on Google App Engine. By: Devesh Sharma. Cloud Computing-the buzzword!. Why Cloud Computing? Traditional Business Applications Expensive Complicated Difficult to manage Idea behind Cloud Computing
E N D
School Supply System onGoogle App Engine By: Devesh Sharma
Cloud Computing-the buzzword! • Why Cloud Computing? • Traditional Business Applications • Expensive • Complicated • Difficult to manage • Idea behind Cloud Computing • Instead of organizations running their business applications by themselves in-house, run them on shared data centers.
Cloud Computing - Advantages • 1. Ease of use • 2. Lower costs • 3. Unlimited storage capacity • 4. Highly automated • 5. Allows IT to shift focus • 6. Scalability
School Supply System • Actors: Parents and Teacher • Features: • Application and database hosted on Google App Engine • Developed Front End using Servlets and JSP’s • Developed Back End using Google App Engine (non relational) datastore • Demo
Google App Engine - Overview • Advantages: • Easy to get started • Automatic Scalability • Reliability, performance and security of Google’s infrastructure • Cost efficient hosting • Risk free trial period
Google App Engine - Services • The Mail Java API • App Engine applications can send and receive email messages • The Mail Service Java API supports the JavaMail interface for sending email messages • Example • The Users Java API • App Engine applications can authenticate users who have Google Accounts • Example • Other services: • Image manipulation, URL fetch, OAuth, etc
Google App Engine - Datastore • Not a relational database, Object Oriented database instead • Datastore stores and performs queries over data objects, known as entities • An entity has one or more properties • App Engine Java SDK includes implementations of the Java Data Objects (JDO) and Java Persistence API (JPA) interfaces
Google App Engine – Datastore (contd..) • Interaction with the datastore using a PersistenceManager object, obtained from PersistenceManagerFactory object • Setting up a PersistenceManagerFactoryinstance takes time to initialize. Therefore, an app should reuse a single instance. • An easy way: wrap it in singleton class, PMF.java • Demo – PMF.java on Eclipse
Google App Engine – Datastore (contd..) • Defining Data classes • Annotations: • @PersistenceCapable • @Persistent • Relationships: • One to One • One to Many • Show Users.java data class in Eclipse
Google App Engine – Datastore (contd..) • Creating data/Making Objects Persistent • Example: • PersistenceManager pm = PMF.get().getPersistenceManager(); Users user = new Users(“Devesh”, “Sharma”,..); try{ pm.makePersistent(user); }finally{ pm.close(); }
Google App Engine – Datastore (contd..) • Queries in App Engine: • JDO includes a query language (JDOQL) for retrieving objects that meet a set of criteria. • Query query = pm.newQuery(Users.class);query.setFilter("lastName == lastNameParam");query.declareParameters("String lastNameParam"); try {List<Users> results = (List<Users>) query.execute(“Sharma"); if (results.iterator().hasNext()) { for (Users u : results) { // ... } } else { // ... no results ... }} finally {query.closeAll();}
Google App Engine – Datastore (contd..) • Updating an Object • Users u = pm.getObjectByID(Users.class, key); U.setFirstName(newFirstName); • Deleting an object • pm.deletePersistent(user);
Google App Engine – Admin Console • Use admin console to: • Create a new application • Add other people as developers • View error logs and analyze traffic • Blacklist IP addresses or subnets – DoS protection service • Browse your application’s datastore and manage indexes • Test new versions of your application, and switch the version that users see • My Admin Console
References: • http://code.google.com/appengine/ • http://code.google.com/appengine/docs/java/overview.html • What is Cloud computing?. (n.d.). Retrieved from http://www.salesforce.com/cloudcomputing/