Creating an e:commerce Application with ASP'NET - PowerPoint PPT Presentation

1 / 47
About This Presentation
Title:

Creating an e:commerce Application with ASP'NET

Description:

... Studio encourages us to use the same programming language. VB, C# or ... The behind-the-scenes code gets an order number, then goes out to the database (still ... – PowerPoint PPT presentation

Number of Views:316
Avg rating:3.0/5.0
Slides: 48
Provided by: stevewad
Category:

less

Transcript and Presenter's Notes

Title: Creating an e:commerce Application with ASP'NET


1
Creating an ecommerce Application with ASP.NET
2
After working through the first Tutorial
  • You should have created a basic ecommerce site
    with the
  • following functionality
  • A User and Log On system
  • A Simple Search Page
  • A Page Displaying Choices
  • A Page for making Payments
  • Website Administration Pages for Site Security

3
Useful Video Tutorials
These tutorials can be found here
4
More Video Tutorials
These tutorials can be found here
5
A Few Words about OOP
  • We have developed programs in
  • JavaScript
  • Visual Basic
  • PHP
  • Without using Object Oriented Programming
  • Techniques

6
What is Object Oriented Programming?
7
Program Variables
  • A program variable is a named area of computer
    memory used to store data

Think of a variable as a box in which data is
stored
8
Program Variables
29
9
Best Practice
  • A webpage is used to supply data to program
    variables
  • The program statements then process the data
    within the variables
  • The results of the processing are then sent from
    the program variables to the webpage

10
GUI, Variables Processing (1)
11
GUI, Variables Processing (2)
The user Clicks the button and a copy of the data
is transferred to program variables
12
GUI, Variables Processing (3)
20
40
Arithmetic and Logic Unit (ALU)
Add
The ALU adds the content of two variables storing
the result in a third variable
Program variable
13
GUI, Variables Processing (4)
Program variable
60
The result of the addition is transferred from
the program variable to the GUI
14
Tutorial Topics
  • Creating a new project to add a class to
  • Adding a class module to the project
  • Adding class code to a module
  • Writing code to create class instances
  • Testing code in classes and in Sub Main

15
(No Transcript)
16
Add the following statements to the Investment
class code
17
Class methods
  • A method to calculate the amount that will be
    returned given a specific set of investment
    parameters (Capital, PIR and Duration)
  • A method to format and print the details of an
    investment

18
(No Transcript)
19
Using the class in a short program
20
(No Transcript)
21
(No Transcript)
22
(No Transcript)
23
Add new investment to my portfolio
Investor
Investment
n
Web Page
Investor
Investment
24
What about Encapsulation?
  • Stop users from
  • Investing more than 1000 pounds
  • Investing for more than 10 years
  • Investing at interest rates greater than 5

25
Public Properties
To protect attributes make them private
Now your programs cant see them
26
Create Public Properties for each Attribute
27
(No Transcript)
28
(No Transcript)
29
Now add the business rules
30
(No Transcript)
31
(No Transcript)
32
Interesting Development
  • Visual Studio encourages us to use the same
    programming language
  • VB, C or whatever
  • Whether we are developing windows applications,
    console applications or web applications.

33
Why Bother with OOP?
34
Northwind Tables
35
A Closer Look at One Table
36
A VB Front-End to Northwind DB
  • Someone has developed a VB
  • application to support this Use Case

Create an Invoice
37
A VB Front-End to Northwind DB
  • The Use Case involves the following
  • three steps
  • Take an order that's already been processed.
  • Work out the value of everything in the order
  • Print it out on a sheet of paper labelled invoice

38
A VB form for the Use Case
39
Possible Design Problems
  • This form looks ok but the programmer has created
    some serious maintenance problems
  • The problems relate to limitations of two-tier
    client server applications

40
What problems?
  • The behind-the-scenes code gets an order number,
    then goes out to the database (still implemented
    in Access), grabs the order information, and
    works out the financial details.

The code to do all of this is in the click event
of this button
41
Another Use Case
Review Cash Flow
This allows the user to enter a couple of dates
and then get a complete list of all the
invoices/orders between those two dates.
42
The Review Cash Flow Form
43
Guess what?
All the code is in the click event for this button
44
The Problem
  • When you pull up an invoice in the Create Invoice
    form, the total is usually different from the one
    that appears in the Review Cashflow form.
  • If only we had an Invoice class

45
Invoice
Date etc
Calculate Total
46
No Duplication of Logic!
  • The code for calculating totals appears in one
    place only
  • The click events on both buttons simply call up
    the Total method on the appropriate Invoice class
  • So theyre bound to be consistent!

47
Sensible Location for Business Logic
  • Future programmers will look for an invoice class
    if they need to update the logic for calculating
    the total value of an invoice
  • Just as they would look for a Customer table in
    the database if they had to change the way we
    store addresses.
Write a Comment
User Comments (0)
About PowerShow.com