© Donald F. Ferguson, 2014. All rights reserved. Topics in Modern Internet Application Development: Lecture 8: Simple Commerce and Databases Dr. Donald.

Slides:



Advertisements
Similar presentations
RP Designs Semi-Custom e-Commerce Package. Overview RP Designs semi- custom e-commerce package is a complete website solution. Visitors can browse a catalog.
Advertisements

Welcome to Middleware Joseph Amrithraj
Apache Struts Technology
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
DT228/3 Web Development multi page applications/ sharing data.
Introduction to Databases Transparencies
© 2004, The Trustees of Indiana University 1 OneStart Workflow Basics Brian McGough, Manager, Systems Integration, UITS Ryan Kirkendall, Lead Developer.
Nikolay Tomitov Technical Trainer SoftAcad.bg.  What are Amazon Web services (AWS) ?  What’s cool when developing with AWS ?  Architecture of AWS 
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Presented by Mina Haratiannezhadi 1.  publishing, editing and modifying content  maintenance  central interface  manage workflows 2.
Software Documentation Written By: Ian Sommerville Presentation By: Stephen Lopez-Couto.
Creating a SharePoint App with Microsoft Access Services
A content management system (CMS) is a computer program that allows publishing, editing and modifying content on a web site as well as maintenance from.
Understanding and Managing WebSphere V5
Product Offering Overview CONFIDENTIAL AND PROPRIETARY Copyright ©2004 Universal Business Matrix, LLC All Rights Reserved The duplication in printed or.
UNIT-V The MVC architecture and Struts Framework.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Web 2.0: Concepts and Applications 2 Publishing Online.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Aurora: A Conceptual Model for Web-content Adaptation to Support the Universal Accessibility of Web-based Services Anita W. Huang, Neel Sundaresan Presented.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
OCLC Online Computer Library Center CONTENTdm ® Digital Collection Management Software Ron Gardner, OCLC Digital Services Consultant ICOLC Meeting April.
PUBLISHING ONLINE Chapter 2. Overview Blogs and wikis are two Web 2.0 tools that allow users to publish content online Blogs function as online journals.
1 Schema Registries Steven Hughes, Lou Reich, Dan Crichton NASA 21 October 2015.
Chapter 6 Server-side Programming: Java Servlets
Module 10 Administering and Configuring SharePoint Search.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
5 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
WebSphere Portal Technical Conference U.S Creating Rich Internet (AJAX) Applications with WebSphere Portlet Factory.
2007. Software Engineering Laboratory, School of Computer Science S E Web-Harvest Web-Harvest: Open Source Web Data Extraction tool 이재정 Software Engineering.
IS 325 Notes for Wednesday August 28, Data is the Core of the Enterprise.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
NA-MIC National Alliance for Medical Image Computing UCSD: Engineering Core 2 Portal and Grid Infrastructure.
© 2007 IBM Corporation SOA on your terms and our expertise Software WebSphere Process Server and Portal Integration Overview.
1 Chapter 1 Introduction to Databases Transparencies.
Design and Implementation of a Rationale-Based Analysis Tool (RAT) Diploma thesis from Timo Wolf Design and Realization of a Tool for Linking Source Code.
WEB 2.0 PATTERNS Carolina Marin. Content  Introduction  The Participation-Collaboration Pattern  The Collaborative Tagging Pattern.
© Donald F. Ferguson, All rights reserved. Topics in Modern Internet Application Development: Lecture 9: Simple Commerce and Databases Dr. Donald.
© Donald F. Ferguson, All rights reserved. Topics in Modern Internet Application Development: Lecture 7: Review, Project Discussion and Directions,
© Donald F. Ferguson, All rights reserved. Topics in Modern Internet Application Development: REST Continued, A Little Security, SaaS, Some DB Dr.
1 © Xchanging 2010 no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging. MOSS Training – UI customization.
DSpace System Architecture 11 July 2002 DSpace System Architecture.
1 Chapter 12 Configuration management This chapter is extracted from Sommerville’s slides. Text book chapter 29 1.
Copyright (c) 2014 Pearson Education, Inc. Introduction to DBMS.
A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and Applications software. Systems.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Business Data Integration with MOSS 2007 Naveedullah Khan PMP, MCAD.NET Senior Consultant.
Apache Struts Technology A MVC Framework for Java Web Applications.
V7 Foundation Series Vignette Education Services.
ArcGIS for Server Security: Advanced
SharePoint 101 – An Overview of SharePoint 2010, 2013 and Office 365
Creating Oracle Business Intelligence Interactive Dashboards
Using E-Business Suite Attachments
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Web Software Model CS 4640 Programming Languages for Web Applications
Software Documentation
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
AMGA Web Interface Vincenzo Milazzo
SharePoint 2010 – SharePoint 101
Distributed Systems through Web Services
Database Management Systems
WEB SERVICES From Chapter 19, Distributed Systems
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Presentation transcript:

© Donald F. Ferguson, All rights reserved. Topics in Modern Internet Application Development: Lecture 8: Simple Commerce and Databases Dr. Donald F. Ferguson

2 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Agenda

3 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Agenda Introduction –Course roadmap –Project discussion, Q&A Composite applications –Core concepts –Traditional approach –Polyglot programming and polyglot database Exploring the commerce application –Content management system overview –Main page –Categories, tags and Redis –Product catalog and SimpleDB –Simple content management system with DynamoDB and S3 Project continuation

4 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Introduction

5 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Course Roadmap No syllabus survives first contact with the lectures  Our original roadmap from lecture 1 is out the window Remaining course roadmap DateTopics 13-Nov-2014Simple commerce application structure and concepts A simple content management system using Redis AWS SimpleDB, DynamoDB 27-Nov-2014Composite application technology Portal Service Bus Information integration Workflow/automation 04-Dec-2014 – 11-Dec-2014 Project discussions and help Final project reviews

6 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Questions? Comments? Discussion?

7 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Composite Applications

8 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Composite Applications – Some Definitions “In computing, a composite application is a software application built by combining multiple existing functions into a new application. … A composite application consists of functionality drawn from several different sources. The components may be individual selected functions from within other applications, or entire systems whose outputs have been packaged as business functions, modules, or web services.” ( “Composition refers to a way of delivering enterprise solutions by assembling them from prebuilt components, instead of building them from scratch. It also includes personalization and customization abilities, so that users can easily and quickly modify specific functionality in the solution.” ( us/library/bb aspx) us/library/bb aspx “A composite application orchestrates independently developed programs, data and devices to deliver a new solution that none of the previously available applications could deliver on its own. Each resource accessed by a composite application uses a different data model. In most cases, the composite application supports user interactions beyond those provided by the leveraged applications. In other cases, a composite application may act as a service. Some composite applications are built by leveraging other composite applications.” (

9 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Composite Applications – Some Pictures

10 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Databases and Use

11 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs SimpleDB Three things DBAs hate –Multi-valued fields –Different tuple formats in a single able –Dynamic addition of columns Using different attributes for different types of things to determine selections on a commerce “order” page.

12 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Backup

13 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs the type of functionality provided by Amazon SimpleDB has been accomplished with a clustered relational database that requires a sizable upfront investment, brings more complexity than is typically needed, and often requires a DBA to maintain and administer. In contrast, Amazon SimpleDB is easy to use and provides the core functionality of a database - real-time lookup and simple querying of structured data - without the operational complexity. Amazon SimpleDB requires no schema, automatically indexes your data and provides a simple API for storage and access. This eliminates the administrative burden of data modeling, index maintenance, and performance tuning.

14 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Reference Material

15 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Reference Material There is no text book for this class –Many books on concepts are language/runtime specific, and I did not want to mandate a “language.” –We are covering a broad set of concepts. Most books are narrower, which means there would be many books. –The “cool” technology evolves faster than we can author and publish books. –Everything I could teach or you need to know “is on the web.” A couple of students asked for books describing concepts independent of language/runtime. –The classics are –“Patterns of Enterprise Application Architecture” by Martin Fowler –“Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions” by Holpe and Wolf. –I checked with colleagues that are active in commercial web application development. The concepts are still relevant. You will see that I use versions of the patterns in my lectures. – The best programmer I have ever known, and someone who mentors new programmers, recommended “Domain-driven Design: Tackling Complexity in the Heart of Software” by Eric Evans. I have not read this book.

16 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs An Interlude on Composite applications Polyglot programming Polyglot database Data flow and control flow programming Messaging Domain Specific Languages and impedance mismatch.

17 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs RabbitMQ

18 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Project Work Items

19 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Application Structure Web Application Customer Controller Agent Controller V V Data Access Service CustomerDS AgentDS ContactDS Business Service CRM Services Customer Facade Agent Facade V V V HTML

20 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs We are going to build a composite app Evolve the simple CRM service –Implementation using new functions, e.g. notification, workflow, rules/policy, new database types, reports, … –“Portal” for on the glass integration of multiple sites. Use a SaaS, web callable product, price, billing, … API Build a very simple, multi-tenant web commerce application (catalog, cart, …) CRM Service Multi-Tenant Commerce Service SaaS Account/ Billing API Cloud Infrastructure APIs S3 SQS OpenID …

21 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Current Assignment Data Access Service CustomerDS AgentDS ContactDS Business Service CRM Services Customer Facade Agent Facade V V V Q UI Controller REST API Web UI Controller may be on server or in browser (e.g. Angular) Standalone App Amazon SQS SQS Adaptor

22 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Current Assignment I – REST API Define and implement a REST API for the simple CRM service Your REST API/implementation must support –Duplicate request detection and discard. –Pagination, e.g. ability to iterate through large result sets. –Support requests that go “asynch” and require polling for the result. –Simple query, e.g. finding customers by last name and zipcode. Demonstrate invoking your API –From Web pages –A “standalone” program calling the REST API –Via an Amazon SQS queue. Implement the following three “rules” in your application objects 1.Agents in the USA, except those in TX and NY can have at most 5 customers. 2.A customer can only update their contact information once/week, unless their agent is in MN or CT. 3.Assigning a new agent to a customer is only allowed if there are no “contact records” less than 72 hours old.

23 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Current Assignment – II Think about the commerce application –There are going to be many, many message exchanges –Browse –Add to cart –Remove from cart –etc. The commerce application needs to remember –What has gone into the cart during this commerce session –What I have searched for during this commerce session –Don’t ask me, “Are you interested in metric wrenches?” –When I am shopping for textbooks. –Just because I looked for screwdrivers three years ago. Technically, –I could have the client store and provide all session information on every request –But, … this is fragile and complicated So, the application –Generates a session key/ID –The client requests always contain the session key either in a cookie or URL (URL rewrite) –Maintains session state in a “database.” –Invalidates the session key/ID when the client logs out or the session times out.

24 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Current Assignment – II Build a simple commerce application –Product –Catalog –Customer –Shopping Cart Customers connect to the commerce application –Creating a commerce session –Search the catalog and view product information –Add items to the cart –Submit the cart You must figure out how to –Implement session behavior, e.g. “find the cart.” –Record what items a customer has viewed during the current session.

25 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Current Assignment III Data Access Service CustomerDS AgentDS ContactDS Business Service CRM Services Customer Facade Agent Facade VVV REST API “RabbitMQ” Subscriptions Notification Service Install and configure RabbitMQ Write a simple application that enables agents to CRUD subscriptions, specifying –Topics –Notify method Listens for events on Rabbit MQ and uses AWS API to notify agent using SNS or SES Modify CRM app to automatically emit events for CUD of customer

26 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs New Material

27 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Session Management

28 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Session State Management References –Patterns of Enterprise Application Architecture, Chapter 17. –Chapter 4: Creating and Managing User Sessions, Sun Java System Application Server Standard and Enterprise Edition Q2 Developer's Guide to Web Applications. ( –The Java EE 6 Tutorial, Chapter 20, Stateful Session Beans We will examine Stateful SessionBeans –Independent of the protocol, i.e. not intertwined with HTTP –Simple, clean demonstration of the concepts –I helped invent it, and you have to learn to use it even if no one uses it.

29 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Stateful SessionBeans Stateful session beans are appropriate if any of the following conditions are true. –The bean’s state represents the interaction between the bean and a specific client. –The commerce application has many active customers. –The cart and browsing history are specific to each customer. –The bean needs to hold information about the client across method invocations. –Is there are cart? What is in the cart? –What has the customer viewed? –The bean mediates between the client and the other components of the application, presenting a simplified view to the client. –Behind the scenes, the bean manages the work flow of several enterprise beans. –Multiple components: catalog, cart, customer information, … –REST calls read and manipulate multiple entitities

30 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Stateful SessionBean Lifecycle

31 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Interface

32 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Implementation

33 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Implementation

34 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Hmmm This seems OK for “stateful” programming –Local Java programming where I can have references to instances –RMI/IIOP –etc. How does this work for REST/URLs? –One URL, e.g. …/cart/addBook?title=“Blah Blah” –Kind of references lots of things –Depending on the client making the call. Use a Façade –Another, user independent, singleton implements interface cart –Extracts customerID for the HTTP header –Looks up the cart in a Map and delegates to the real cart –If the “real cart” does not exist, it create a cart and puts in the map. Do not do you assignment this way –This tutorial is awful. “Cart” is an EntityBean, not a SessionBean. –A REST/HTTP Session would typically have state independent of Stateful SessionBeans. –I used this example to help draw the distinction between pattern and realization.

35 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Commerce and Content Management

36 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Some New Data Models

37 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Query Results {author, “Ferguson”} {includes, {paper, {author, “Ferguson”}}} {references, {book, {author, “Ferguson”}}}

38 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Data and Rendering Two different renderings Of the same underlying document

39 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Content Management System Some Terminology A content management system (CMS) is a computer application that –Allows publishing, editing and modifying content, organizing, deleting as well as maintenance from a central interface. –Such systems of content management provide procedures to manage workflow in a collaborative environment. A web content management system is a bundled or stand-alone application –To create, deploy, manage and store content on Web pages. –Content includes text and embedded graphics, photos, video, audio, … –Content includes code that displays content in a specific way –A Web CMS may catalog and index content, select or assemble content at runtime, or deliver content to specific visitors in a requested way, such as other languages.

40 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs CMS Data Model

41 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Why Don ’ t I Just Use … A relational database? RDBs do not handle –Dynamic taxonomies/folders particularly well. –Relatively free form tagging and query of items. –You can realize the model in relational, but you have to write a specific schema. –Your code is awkward and you write “framework,” which is a CMS. A file system? –File systems do not handle arbitrary metadata well. I want to find documents with author=“Ferguson” not containing the text “Ferguson.” –I want to publish or rollback all changes made by Bob in the last 24 hours. –Jim must approve all contributions of type “Press Release.” MongoDB? –Handle hierarchical and dynamic tags well. –Not great for images, audio, … –Would still need some framework code.

42 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Apache Jackrabbit

43 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs The Simple Commerce Application Needs a CMS Product classification, e.g. –Classification I: Books, Magazines, Videos –Classification II: Sports, Engineering, Business Relatively freeform, queryable information –Artist Type = {Author, Editor, Contributor, Reviewer, …}.Name={…} –Format = {eBook, paperback, audiobook, …} Fragments of a rendering, e.g. –Images –Reviews –Descriptive prose –TOC Various renderings, e.g. –Summary in a search result –Full information

44 © Donald F. Ferguson, All rights reserved.Modern Internet App Development – Lecture 8: Simple Commerce, Content Management, Some DBs Commerce Application We are not going to use a full functional CMS –Powerful, but complex to set up and use. –Hides some interesting concepts. –Conflates orthogonal concepts. We are going to use –Redis for tracking what users have viewed, usage frequency, etc. –S3 for storing “content” and associated metadata –Images,.WAV files, etc. –Created date, author, tags, … –SimpleDB for product descriptions, categories, …