Presentation is loading. Please wait.

Presentation is loading. Please wait.

SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.

Similar presentations


Presentation on theme: "SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin."— Presentation transcript:

1 SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin

2 Agenda – Lecture 6a Review & renew Design principles Servlets, JSPs
(Homework) Solutions to Exercise Set 4. UML: visibility Design principles Encapsulation and information hiding. GRASP: Controller. Servlets, JSPs MVC 4/21/2019 SOEN 343, © P.Chalin,

3 Homework was … Planned (e.g. MDD) vs. Evolutionary (e.g. XP)
How does each approach address: No doc. produced. Increased gap: design vs. implementation. Add-on syndrome. 4/21/2019 SOEN 343, © P.Chalin,

4 Homework Planned (e.g. MDD) vs. Evolutionary (e.g. XP)
How does each approach address: No doc. produced: MDD: design documentation is the code. XP: code is the design documentation . Increased gap: design vs. implementation : doc must be maintained because it is the code. Add-on syndrome: refactoring. 4/21/2019 SOEN 343, © P.Chalin,

5 Enterprise Application Layers
4/21/2019 SOEN 343, © P.Chalin,

6 Enterprise Application Layers
Presentation Domain Logic Data Source 4/21/2019 SOEN 343, © P.Chalin,

7 Web EA Overhead 4/21/2019 SOEN 343, © P.Chalin,

8 Layering (Larman) See Larman Sect 30.2 for examples of layer content.
4/21/2019 SOEN 343, © P.Chalin,

9 Exercise Set 4 Solution covered in class. SOEN 343, © P.Chalin,
4/21/2019 SOEN 343, © P.Chalin,

10 Code Sample: Class C public class C { private static int sc = 0;
private int c = 0; public void m() { ….println(“sc=” + sc++); ….println(“c=” + c++); } 4/21/2019 SOEN 343, © P.Chalin,

11 Code Sample: Using C C c = new C(); c.m(); C c2 = new C(); c2.m();
4/21/2019 SOEN 343, © P.Chalin,

12 UML Class Diagrams: Visibility
public int a + a: int private int a - a: int protected int a # a: int /* package */ int a ~ a: int int a ~ a: int 4/21/2019 SOEN 343, © P.Chalin,

13 [Encapsulation and Information Hiding]-----------------

14 Access points at interface
Encapsulation A programming/design language mechanism. A packaging / scoping mechanism for names Names can refer to data, types, … Especially, a means of packaging data. Access points at interface 4/21/2019 SOEN 343, © P.Chalin,

15 Information Hiding Design principle by which a module is assigned a “secret”. A module’s secret is usually A design decision. What type of design decisions might we want to hide from the clients of a module? 4/21/2019 SOEN 343, © P.Chalin,

16 Information Hiding Often one hides, e.g.
Data representation. Choice of algorithm. Interface details / access mechanism of external entity (e.g. database, hardware) Goal: particular design choice “invisible” to clients. Why would we want to do this? 4/21/2019 SOEN 343, © P.Chalin,

17 Information Hiding Information Hiding may or may not be supported a the programming language level. 4/21/2019 SOEN 343, © P.Chalin,

18 Servlet: HelloWeb public class HelloWebServlet extends HttpServlet {
protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException ServletOutputStream out = response.getOutputStream(); out.println("Hello Web!"); } 4/21/2019 SOEN 343, © P.Chalin,

19 Java Server Page Servlet: JSP Embed HTML inside code.
Embed code inside HTML. 4/21/2019 SOEN 343, © P.Chalin,

20 HelloWeb.jsp <%@ page
contentType="text/html; charset=iso " language="java" ... %> <html> <body> Hello Web! </body> </html> 4/21/2019 SOEN 343, © P.Chalin,

21 Hello.jsp page contentType="text/html; charset=iso " language="java" ... %> <html> <body> Hello <%= request.getParameter("name") %> </body> </html> 4/21/2019 SOEN 343, © P.Chalin,

22 Java Server Page Implemented as a (special kind of) servlet.
4/21/2019 SOEN 343, © P.Chalin,


Download ppt "SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin."

Similar presentations


Ads by Google