3/3/15 Announcement: Bug of the week (extra credit) Architectural - - PDF document

3 3 15
SMART_READER_LITE
LIVE PREVIEW

3/3/15 Announcement: Bug of the week (extra credit) Architectural - - PDF document

3/3/15 Announcement: Bug of the week (extra credit) Architectural Patterns Each group can nominate a bug TA choose one to be bug of the week . Group gets extra credit. Bug due Sunday evening. Database-centric


slide-1
SLIDE 1

3/3/15 1

1

Architectural Patterns

Database-centric Model/View/Controller Games

CS361-10 2

Announcement: Bug of the week (extra credit)

❚ Each group can nominate a “bug” ❚ TA choose one to be “bug of the week”. Group gets extra credit. ❚ Bug due Sunday evening. ❚ “Bug” can be any mistake; requirements, build, documentation. Best bugs will have “lesson learned”.

More announcements

❚ Final project hand in (Mon-Tue, March 9-10)

❙ Update the documentation to match the current system (don’t simply copy-paste from HW2/HW3)

CS361-10 3 CS361-10 4

Database-centric

❚ Relational database management system

❙ Keep data safe

❘ Crash recovery, human readable, adaptable

❙ Concurrency control

❘ Transactions - ACID (Atomicity, Consistency, Isolation, Durability)

❙ Integrate different applications ❙ Ad hoc querying

CS361-10 5

Advantages of RDBMS

❚ Safety, concurrency, integration, queries ❚ Standard

❙ Compatible tools ❙ Expert developers

❚ Scalable (with cost)

CS361-10 6

Disadvantages of RDBMS

❚ Performance bottleneck ❚ Object-relational impedance mismatch

❙ Must convert between tables and objects ❙ Differing notions of identity ❙ RDBMS do not support interfaces, inheritance, collections

❚ Tables not good for trees and graphs ❚ RDBMS work well for financial domain, not so well for the engineering fields

slide-2
SLIDE 2

3/3/15 2

CS361-10 7

RDBMS for integration

DBMS App App App App

CS361-10 8

New app …

❚ Reuse old tables ❚ Add new table ❚ Add column to old table ❚ Moving/deleting column is hard because

  • ld apps must be changed

CS361-10 9

DB Administrator

❚ Responsible for database design ❚ Ensure database is well-designed ❚ Ensure schema changes slowly

CS361-10 10

OO Domain Model

❚ “Domain model” is a set of classes ❚ Applications talk to domain model. ❚ Domain model talks to database.

  • Martin Fowler –
  • Patterns of Enterprise Application Architecture

CS361-10 11

Alternatives to DBMS

❚ Persistence

❙ Flat files ❙ XML

❚ Concurrency

❙ Prevayler-style in-memory database

❚ Integration

❙ SOA, message bus

CS361-10 12

❚ prevayler.org ❚ Keep all data in memory ❚ Store snapshot of data on disk, then log every change to the data ❚ Change data using Command pattern

❙ Log all commands ❙ Lock all commands

slide-3
SLIDE 3

3/3/15 3

CS361-10 13

Prevayler trade-offs

❚ +Very fast ❚ +No object-relational impedance ❚ -Data must fit in memory ❚ -No query language

CS361-10 14

Model/View/Controller

❚ UI implementation pattern ❚ Separate UI from application so UI can be reused ❚ Model - application data ❚ View - displays data ❚ Controller - maps user events into changes to the data

CS361-10 15

Model/View/Controller

Model View Controller

CS361-10 16

Model/View/Controller

❚ In original MVC,

❙ View is a composite ❙ View is observer of Model ❙ Controller is strategy for handling input ❙ (active) Model pushes notifications to the list

  • f registered viewers

CS361-10 17

Model/View/Controller

❚ In web systems,

❙ View is a template used to generate page ❙ Controller is code used to handle “post” ❙ No “observer” relationship between the view and the database (passive implementation)

CS361-10 18

Design Principle: separate presentation from data

❚ Make it easier to change presentation

❙ from desktop, to web-based, to smartphone

❚ Make it easier to change data ❚ Make presentation objects more reusable ❚ Allow people to specialize in data or in presentation

slide-4
SLIDE 4

3/3/15 4

CS361-10 19

Separating presentation from data

❚ Hard to separate completely

❙ New feature requires change to data and to UI

❚ Cross-functional teams - UI and data

CS361-10 20

MVC in games

http://www.koonsolo.com/news/model- view-controller-for-games/ http://www.koonsolo.com/news/dewitters- gameloop/

CS361-10 21

MVC in games

❚ Real-time game consists of a game loop

❙ Get input ❙ Update game ❙ Display game

❚ Make “display game” a separate object so that game code is simpler

CS361-10 22

MVC in games

❚ Put user input in a controller ❚ Controller needs to query view to find location of on-screen objects ❚ Easier to test game code (i.e., the model) automatically

CS361-10 23

MVC in games

Model View Controller

CS361-10 24

Architectural Patterns

❚ Determine how program is divided into modules ❚ Have advantages and disadvantages ❚ Influence non-functional requirements / software quality ❚ Must be learned

slide-5
SLIDE 5

3/3/15 5 Architectural Patterns Books

CS361-10 25 CS361-10 26

Next time

❚ Career options in Software Engineering