Although this site has been produced for specific courses and groups of students it is designed as a public resource. If you find it useful then please let me know.

If you want to comment feel free to do so and if you find something wrong get in touch.

hide alert

How do we develop e-commerce sites at the OTHER media? (lecture 9)

Written by: Jonathan Briggs

November 29, 2004 [3513 views]

This week’s lecture has been written in association with Rich Aston, one of the senior technical developers at the OTHER media and the person who defined our current technical approach e-commerce sites based on Enterprise Java. This session will explore the choices that we made but should not be taken as a particular recommendation. Other companies will be equally successful using .NET or other approaches.

Changing the way sites are developed
  • Most developers started by hand-coding individual pages
  • Design tools (such as Dreamweaver and FrontPage) supported this page orientated view
  • Some tools (NetFusion) encouraged the use of templates and the reuse of page elements
  • Reuse could be achieved at the code level through approaches such as Server Side Includes (SSIs) in which sections of code are stored in a library and referenced from individual pages
  • Larger sites were achieved by linking databases to web servers and pulling data when needed to fill page templates using server-side scripting languages such as ASP or PHP
  • Content management systems (or admin systems) were coded (often in the same scripting languages) to allow page data to be updated
  • Recently this page view has been replaced (at least at the OTHER media) by considering sites as applications rather than as sets of documents.
What are developers trying to achieve in selecting an approach to web development?
  • to design and develop sites easily and quickly
  • to work as a team and effectively with designers and clients
  • to reuse components and code from other projects
  • to create reliable and scalable code
  • to work across platforms and integrate with other software components
  • to create secure fast applications
What is wrong with the scripting approach?
  • Scripts combine presentation (design) and business logic
  • Scripts often refer directly to database queries
  • Hard to debug and maintain
  • Hard to add some types of functionality (such as customer tracking or additional security) without modifying every page individually
The MVC (model-view-controller) design pattern
  • A “pattern” is a repeatable way of designing, performing or constructing
  • Invented by the Smalltalk team at Xerox in 1970’s
  • First used on the web by Steve Job’s NeXT (now Apple)
  • Sun recommends it as a pattern for developing Java Web Apps
  • MVC separates out different parts of a problem
    -How things will work (from a business point of view)
    -How things will look
    -How things will work (inside the application)
Enterprise Java Servlets for MVC
  • Servlets were designed for MVC
  • Supported by a huge dedicated open source community of developers
  • Run on many different platforms (Unix, Mac, Windows, Linux)
View
  • Defines the look & feel and usability of site
  • There should be no business logic in views
  • Sun recommends using JSP to implement the view component
  • We prefer to use a template engine such as Velocity
  • Velocity provides no support for code!
  • It was a simple syntax that is can be learned by designers
  • It supports the creation of hierarchical templates
  • It can be used to create non-HTML views such as PDF, XLS, JPG and XML
Model
  • Represents the business logic for the problem domain
  • Data and logic in are represented using standard Java beans (get/set)
  • A persistence mechanism allows data to be remembered between and within a set of transactsions
  • Data access objects (DAO) are used to fetch objects
  • We use Hibernate to create an Object Relational Mapping Hibernate
  • ORM turns SQL data into objects
  • Generates SQL updates to persistant model objects
Controller
  • Central point of control for the site – think of it like an application
  • Connects the model and the view
  • Similar across all sites
  • Controller uses Actions to update model
  • Actions are site specific
Web application frameworks
  • A framework provides a set of tools and techniques for implementing higher level applications (such as MVC)
  • Form processing + validation
  • User authentication and security
  • Link generation + view selection
  • Parameter handling
  • Browser detection
  • Scheduling
Popular frameworks
How to build an MVC site
  • Set hosting environment
  • Install framework
  • Build model
  • Map model objects to database
  • Design views
  • Glue together with controller actions
A few other things to consider
  • Documentation: JavaDoc
  • Test driven development: JUnit, Cactus
  • Consistent style: Sun Style Guide
  • Use a good IDE: Eclipse, IntelliJ

Recent comments:

On December 29, 2004 at 9:28 PM, phil jenkins wrote:

Jonathon, Thanks again for an interesting and thought provoking MSc module. I was especially interested in the approach to design at The Other Media, but didn't get a chance to ask you your opinion on multimedia content in e-commerce (Flash, streaming video, audio, etc). Have you published anything on this subject or can you point me in a useful direction for some other opinions?
I hope New York is not too cold : )
Regards Phil

On December 29, 2004 at 9:33 PM, Jonathan (from a snowy US!) wrote:

Thanks for your participation in the MSc module Phil - I enjoyed it too.

We have done some Flash, video and audio work for our clients but generally find these slow down many sites and reduce visitor-customer conversion.

I am personally interested in a greater use of audio in my educational sites (short lectures in MP3 are an interesting ppssibility) and know that Flash used well can be wonderful in illustrating products and services.

There are many agencies that still push Flash but unless they are really good the results are often disappointing.

What do you think?







Add your comments