Download presentation
Presentation is loading. Please wait.
Published byOphelia Dickerson Modified over 6 years ago
1
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin
2
Agenda – Lecture 7a Review & renew. Data Source Patterns
Exercise set 6 12/5/2018 SOEN 343, © P.Chalin,
3
Opening Remarks Did I mention that … … there will be an exercise set.
12/5/2018 SOEN 343, © P.Chalin,
4
Enterprise Application Patterns
Page Controller Template View Presentation Front Controller Transform View Transaction Script Domain Model Domain Active Record Row Data Gateway Data Mapper Data Source Table Data Gateway 12/5/2018 SOEN 343, © P.Chalin,
5
Presentation Domain Data Source Data Source Patterns Page Controller
Template View Presentation Front Controller Transform View Transaction Script Domain Model Domain Active Record Row Data Gateway Data Mapper Data Source Table Data Gateway 12/5/2018 SOEN 343, © P.Chalin,
6
Data Source Patterns Hide SQL. Provide an abstraction for
One data row. A collection of data row(s). 12/5/2018 SOEN 343, © P.Chalin,
7
Example: Person-Grade Table
Table attributes: name : String grade : int name grade 12/5/2018 SOEN 343, © P.Chalin,
8
Table Data Gateway PersGrade TDG find(name) : ResultSet
findInRange(fg,tg) : ResultSet insert(name,grade) update(name,grade) delete(name) No fields. Find methods return ResultSet 12/5/2018 SOEN 343, © P.Chalin,
9
Table Data Gateway: Find Code
12/5/2018 SOEN 343, © P.Chalin,
10
Table Data Gateway: FindInRange
12/5/2018 SOEN 343, © P.Chalin,
11
Row Data Gateway PersGradeRDG - name : String - grade : int
find(name) : PersGradeRDG insert() : void update() : void delete() : void … getters and setters … Fields – table columns. Finder methods: static. insert, update, delete on instance. 12/5/2018 SOEN 343, © P.Chalin,
12
Row Data Gateway: Find Code
12/5/2018 SOEN 343, © P.Chalin,
13
Active Record (Row Data Gateway)
PersGrade AR name : String grade : int find(name) … // like RDG delete() // Can also have domain logic getRank() 12/5/2018 SOEN 343, © P.Chalin,
14
Exercise Set 6 12/5/2018 SOEN 343, © P.Chalin,
15
Server-web.xml-servlet
12/5/2018 SOEN 343, © P.Chalin,
16
12/5/2018 SOEN 343, © P.Chalin,
17
RDG & TDG 12/5/2018 SOEN 343, © P.Chalin,
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.