designing complex software systems: introduction cs 6961 – lecture 0 nathan dykman

19
Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Upload: alyson-fletcher

Post on 03-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Designing Complex Software Systems: Introduction

CS 6961 – Lecture 0

Nathan Dykman

Page 2: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Administration

• See me after class if you need add codes.

• Questions before we start?

Page 3: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Instructor Reference Manual

• Things you should note:– If left unchecked, I can go way fast

• I have lots of enthusiasm for the area• Maybe too much

– I will try to pace myself, but help me out• Ask questions, add comments, and so on.

– I will try to remember that silence is not complicit understanding

• But speaking out helps as well

Page 4: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

The Lay of the Land

• The class will focus a set of modeling and other techniques for the specification and design of complex systems.

• Modeling: “Software Blueprints”– In this class, we focus on UML (Unified

Modeling Language) as the language we used to model.

• We also will discuss areas from RUP, XP, Agile, etc. as need.

Page 5: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

What is UML?

• A modeling language standardized by the OMG, and widely used in OO analysis and design– A modeling language is a visual language for

representing software blueprints– Latest version is 2.0

• UML provides a standard notation, semantics for a set of OO abstractions

Page 6: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

UML is a Modeling Language

• Modeling often refers to a (graphical) representation of software systems at higher levels of abstraction than code– UML has some “code-like” features.

• Modeling supports analysis and design of software.– Requirements, architecture and design is the

areas we will focus on.

Page 7: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Modeling

• Modeling a growing, evolving area:– Modeling tools a part of every major IDE

• Eclipse, JBuilder, Visual Studio. Net, etc.– Not in Emacs. Nothing personal, mind you.

• Modeling a multi-billion market – Projected to undergo more growth in the next 5-7 years

– UML 2.0 now considered by many to be “most successful” OMG standard ever

• Well, it gets the most noise, anyway.• Many major companies interested in modeling.

Page 8: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Modeling

• Modeling is a “potential paradigm shift” in software development– Now: Models are a view on code– Later(?): Code and models mix (code

generation, toolkits)– Future(??): Domain Specific Modeling

Languages, Executable Models

• I believe modeling could become a large force in software development.

Page 9: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

My Experiences• Been using UML modeling since 1997.

– In fact, I find it hard to do OO programming without UML tools now.

• I have applied UML ideas in industry and research– Industry: Lawrence Livermore National Labs,

BEA, HP, Hill Air Force Base and more– Research: MS Thesis, UML 99 conf. paper

• One of the main authors of the UML 2.0 Specification

Page 10: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Applying Modeling, Process

• This class will have you apply UML in the context of three major “disciplines”– Requirements– Architecture/Analysis– Design

• You will create models in this area in the context of a project of your choosing– Learning to apply UML as you go along.

Page 11: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Why Project Based?

• I could structure the class more around lecture, homework, tests, but…– I think the real value comes in application

• What to keep, what to toss, what to change.

– Also, no one “right way” to model.

• I think you will get more out of a project-based course in this area– I could be wrong. We can adjust if needed.

Page 12: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

“Quizzes”

• To make sure that I’m conveying information effectively, I will have you do small homework assignments to judge understanding– Homework will be 1 or 2 questions, should

require no more than 30-45 minutes total– No quizzes the week before a project due

• Keep me honest on this.

Page 13: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

UML Class Example

• Fowler notes that often, a Class Diagram is the first UML model you will see.

• So, let’s see an example.– A bit “real world” if you will.

Page 14: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

BBox2d

# have_some : bool# min_ : Point2d# max_ : Point2d

# «friend» Pio ( )+ BBox2d ( )+ ~BBox2d ( )+ BBox2d ( )+ BBox2d ( )+ valid ( )+ reset ( )+ extend ( )+ extend ( )+ min ( )+ max ( )+ inside ( )

BoxObj

- sx_ : double- sy_ : double- mode_ : int- proj : double [16]- model : double [16]- viewport : int [4]+ type_id : PersistentTypeID = ("BoxObj"

+ BoxObj ( )+ ~BoxObj ( )+ recompute ( )+ select ( )+ move ( )+ release ( )+ draw ( )+ io ( )

Diagram

- active_ : Array1<bool>- poly_ : Array1<DrawObj *>- widget_ : Array1<Widget *>- zoom_stack_ : stack<int>- window_ : string- selected_ : int- selected_widget_ : int- gui_select : GuiInt *- gui_scale : GuiInt *- select_mode_ : int- scale_mode_ : int- draw_mode_ : DrawMode- operate_mode_ : OperateMode- changed_ : bool- ctx : GuiContext*+ type_id : PersistentTypeID

+ Diagram ( )+ ~Diagram ( )+ add ( )+ add_widget ( )+ redraw ( )+ update ( )+ reset_bbox ( )+ get_bounds ( )+ tcl_command ( )+ set_id ( )+ set_windows ( )+ get_active ( )+ x_get_at ( )+ y_get_at ( )- button_press ( )- button_motion ( )- button_release ( )- pan_start ( )- pan_move ( )- pan_end ( )- add_hairline ( )- add_axes ( )- add_zoom ( )- zoom_in ( )- zoom_out ( )- child_changed ( )+ draw ( )+ io ( )

Drawable

- lock_ : Mutex *- name_ : string- enabled_ : bool+ type_id : PersistentTypeID = ("Drawable"

+ Drawable ( )+ ~Drawable ( )+ lock ( )+ unlock ( )+ name ( )+ set_name ( )+ parent ( )+ set_parent ( )+ is_enabled ( )+ enable ( )+ set_opengl ( )+ need_redraw ( )+ reset_bbox ( )+ get_bounds ( )+ draw ( )+ io ( )

DrawGui

# menu_ : string# tb_ : string# ui_ : string

+ DrawGui ( )+ ~DrawGui ( )+ set_windows ( )+ redraw ( )

DrawObj

- name_ : string- lock_ : CrowdMonitor *# color_ : Color+ type_id : PersistentTypeID = ("DrawObj"

+ DrawObj ( )+ ~DrawObj ( )+ set_lock ( )+ read_lock ( )+ read_unlock ( )+ write_lock ( )+ write_unlock ( )+ name ( )+ tcl_color ( )+ set_name ( )+ parent ( )+ set_parent ( )+ set_opengl ( )+ need_redraw ( )+ reset_bbox ( )+ get_bounds ( )+ child_changed ( )+ add ( )+ draw ( )+ io ( )

Graph

- has_work_ : ConditionVariable

+ Graph ( )+ ~Graph ( )+ lock ( )+ unlock ( )+ add ( )+ tcl_command ( )+ set_window ( )+ update ( )+ need_redraw ( )+ get_bounds ( )+ draw ( )+ io ( )

GraphHelper

- lock_ : Mutex

+ GraphHelper ( )+ ~GraphHelper ( )+ run ( )

- graph_«Friend Permission»

- obj_

- helper_

- parent_

- graphs_bounds_

- screen_

- parent_

Hairline

- poly_ : Array1< DrawObj *>+ type_id : PersistentTypeID

+ Hairline ( )+ Hairline ( )+ ~Hairline ( )+ update ( )+ select ( )+ move ( )+ release ( )+ draw ( )+ io ( )

- parent_

HairObj

# from_ : double# to_ : double# pos_ : double# proj : double [16]# model : double [16]# viewport : int [4]+ type_id : PersistentTypeID = ("HairObj"

+ HairObj ( )+ ~HairObj ( )+ get_bounds ( )+ at ( )+ recompute ( )+ select ( )+ move ( )+ release ( )+ draw ( )+ io ( )

HistObj

# ref_ : Array1<double># bins_ : int# ref_min_ : double# ref_max_ : double+ type_id : PersistentTypeID = ("HistObj"

+ HistObj ( )+ HistObj ( )+ ~HistObj ( )+ set_bins ( )+ set_data ( )+ at ( )+ get_bounds ( )+ draw ( )+ io ( )- compute ( )

LockedPolyline

+ type_id : PersistentTypeID = ("LockedPolyline"

+ LockedPolyline ( )+ LockedPolyline ( )+ LockedPolyline ( )+ ~LockedPolyline ( )+ at ( )+ add ( )+ draw ( )+ io ( )

OpenGLWindow

- lock_ : Mutex *- win : Window- dpy : Display*- cx : GLXContext- base : GLuint- xres_ : int- yres_ : int- bg_ : Color- fg_ : Color# initialized_ : bool

+ OpenGLWindow ( )+ ~OpenGLWindow ( )+ lock ( )+ unlock ( )+ init ( )+ initialized ( )+ tcl_command ( )+ clear ( )+ pre ( )+ post ( )+ set_cursor ( )+ set_cursor_file ( )+ set_binds ( )+ print_string ( )+ sub_window ( )+ resize ( )+ xres ( )+ yres ( )# report_init ( )# make_raster_font ( )

# ogl_

# ogl_

ParametricPolyline

# data_ : map< double, pair<double,double> ># tmin_ : double# tmax_ : double# xmin_ : double# xmax_ : double# ymin_ : double# ymax_ : double# color_ : Color+ type_id : PersistentTypeID = ("ParametricPolyline"

+ ParametricPolyline ( )+ ParametricPolyline ( )+ ParametricPolyline ( )+ ~ParametricPolyline ( )+ at ( )+ compute_minmax ( )+ add ( )+ clear ( )+ tcl_color ( )+ set_color ( )+ get_color ( )+ get_bounds ( )+ add ( )+ draw ( )+ io ( )

ScrolledOpenGLWindow

+ ScrolledOpenGLWindow ( )+ ~ScrolledOpenGLWindow ( )+ tcl_command ( )

- ogl_

Vector2d

- x_ : double- y_ : double

+ Vector2d ( )+ Vector2d ( )+ Vector2d ( )+ Vector2d ( )+ length ( )+ length2 ( )+ «friend» Dot ( )+ «friend» Dot ( )+ «friend» Dot ( )+ operator= ( )+ operator() ( )+ operator() ( )+ operator[] ( )+ operator[] ( )+ operator== ( )+ operator!= ( )+ operator* ( )+ operator* ( )+ operator*= ( )+ operator/ ( )+ operator/ ( )+ operator/= ( )+ operator+ ( )+ operator+= ( )+ operator- ( )+ operator- ( )+ operator-= ( )+ normalize ( )+ normal ( )+ «friend» Abs ( )+ x ( )+ x ( )+ y ( )+ y ( )+ point ( )+ get_string ( )+ get_h_file_path ( )+ «friend» Pio ( )+ asPoint ( )+ minComponent ( )+ maxComponent ( )

Page 15: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Gotcha

• No, this isn’t how you learn class diagrams– We will start with simpler ones, of course.

• This is a section of a class library from SCIRun.– 2D Core for SCI Run environment.– Made from reverse engineered C++– Layout of class model done by hand

Page 16: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Okay, What’s the Point?

• Okay, you are in SCI working on SCIRun. You have to get to know the code.

• Would you prefer:– A: Browse though the files to look at the code,

using the directory structure as a guide.– B: Browse though class models, being able to

click on a class to view code.• I’d chose B (I can always do A).

Page 17: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Complex Systems

• Sure, a big system may have 100s of diagrams to look over– But, it’s 100,000s lines of code!

• UML allows me to document structural aspects of software– UML can also show behavioral aspects of

software as well. – We will cover both areas in this class.

Page 18: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

Modeling as Exploration

• I use UML tools to explore existing code bases.– For OO system, it works really well.– I find it useful to go through the reverse

engineering process, to get that to work.– I like being able to just place classes in a

diagram and see how they relate to each other

• Most tools do this very well.

Page 19: Designing Complex Software Systems: Introduction CS 6961 – Lecture 0 Nathan Dykman

For Next Time

• Brainstorm potential project ideas– Things you might want to work on, etc.

• Bring in a list of this you want to learn about or cover in more detail.– Again, help shape the class

• Bring your friends– A good size class is always welcomed.