Download presentation
Presentation is loading. Please wait.
1
CSE 403 Software Design
2
References Anderson, Richard. ‘Design Patterns’ Lecture JDepend. JavaNCSS.
3
Question to keep in mind
How is you design coupled?
4
Experts vs. Novices Experience Higher level thought Chunking Idioms
Techniques Examples
5
Examples of expertise Chess playing Mathematics Programming
Experts view pieces in groups Mathematics Integration by trigonometric substitution Programming for (int i = 0; i < n; i++) a[i] = b[i];
6
Design patterns in Architecture
Alexander: "Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to the problem. In such a way that you can use this solution a million times over, without ever doing it the same way twice."
7
Design Pattern Pattern name: Strip mall.
Problem: Make small commercial establishments and franchises accessible to car driving customers. Solution: Parking area with store fronts facing parking. Uniform construction. Consequences: Traffic flow, congestion, parking availability, building rents.
8
Gang of Four Gamma, Helm, Johnson, Vlissides
Catalog of design patterns for software
9
Classification of patterns
Creational Abstract factory, builder, factory method, prototype, singleton Structural Adapter, bridge, composite, decorator, façade, flyweight, proxy Behavioral Chain of responsibility, command, interpreter, iterator, mediator, memento, observer, state, strategy, template method, visitor Original GoF patterns
10
Model/View/Controller
Example of putting basic design patterns together Model - internal representation of the data and how it changes View - display of the model (can be more than one) Controller - how the model is controlled by user Goal - be able to change views and controllers without changing the model or knowing details of model
11
JDepend Example <target name="jdepend">
<jdepend format="xml" outputfile="docs/jdepend-report.xml"> <sourcespath> <pathelement location="classes" /> </sourcespath> <classpath location="classes" /> </jdepend> <style basedir="docs" destdir="docs" includes="jdepend-report.xml" style="${ant.home}/etc/jdepend.xsl" /> </target>
12
JavaNCSS Example <taskdef name="javancss"
classname="javancss.JavancssAntTask" classpath="${CLASSPATH}"/> <target name="javancss"> <javancss srcdir="src" includes="**/*.java" generateReport="yes"/> </target>
13
Setup Needed for Examples
JDepend Make sure $JDEPEND_HOME/lib/jdepend.jar is in CLASSPATH JavaNCSS Make sure all Jar-files in $JAVANCSS_HOME/lib are in the CLASSPATH
14
Back to the Question How is you design coupled?
Tightly Coupled or Loosely? MVC attempts for a Loosely Coupled System Generally Loosely Coupled is Better
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.