13

Three Layer Architecture Why Bother with the Middle Layer?

Embed Size (px)

Citation preview

Page 1: Three Layer Architecture Why Bother with the Middle Layer?
Page 2: Three Layer Architecture Why Bother with the Middle Layer?

Three Layer Architecture

Page 3: Three Layer Architecture Why Bother with the Middle Layer?

Why Bother with the Middle Layer?

Page 4: Three Layer Architecture Why Bother with the Middle Layer?

Consider Facebook

PC

Phone

Tablet

Page 5: Three Layer Architecture Why Bother with the Middle Layer?

Without a Middle Layer…

Web browser(Add Update etc.)

Android device(Add Update etc.)

Apple device(Add Update etc.)

Presentation Layer Middle Layer Data Layer

Page 6: Three Layer Architecture Why Bother with the Middle Layer?

Include the Middle Layer…

Web browser

Android device

Apple device

Presentation Layers

Middle Layer(Add

UpdateDelete

ValidateQuery Results)

Data Layer

Page 7: Three Layer Architecture Why Bother with the Middle Layer?

Designing Classes

Page 8: Three Layer Architecture Why Bother with the Middle Layer?

The SpecificationYou are required to create a web based

application that allows a user to store address details. The user should be able to add, edit and delete addresses. Each address should be validated to capture any errors in the data. A typical address should consist of house no, house name, street, town, post code, county code, date added and a flag for active. All addresses will be stored in a suitable database.

Page 9: Three Layer Architecture Why Bother with the Middle Layer?

Identify the NounsApplicationAddressAddressesUserDataDatabase

Page 10: Three Layer Architecture Why Bother with the Middle Layer?

List the MethodsAddEditDeleteValidate

Page 11: Three Layer Architecture Why Bother with the Middle Layer?

Find the Propertieshouse nohouse namestreettownpost codecounty codedate added active

Page 12: Three Layer Architecture Why Bother with the Middle Layer?

Draw the Class

Addresshouse no : stringhouse name : stringstreet : stringtown : stringpost code : stringcounty code : integerdate added : dateactive : BooleanAdd() : BooleanEdit() : BooleanDelete() : BooleanValidate() : String

Page 13: Three Layer Architecture Why Bother with the Middle Layer?

Now we write the code…