New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Software Design

by: Donnell Kertzmann

Software Design CSE 335

Donnell Kertzmann
GPA 3.97


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Computer Science and Engineering

This 18 page Class Notes was uploaded by Donnell Kertzmann on Saturday September 19, 2015. The Class Notes belongs to CSE 335 at Michigan State University taught by Staff in Fall. Since its upload, it has received 15 views. For similar materials see /class/207422/cse-335-michigan-state-university in Computer Science and Engineering at Michigan State University.

Similar to CSE 335 at MSU

Popular in Computer Science and Engineering


Reviews for Software Design


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/19/15
Synthetic OOD Concepts and Reuse Lecture 3 Separation of concerns Topics Separation of concerns as a general principle for managing complexity in software designs Example problem Need to isolate operations over composite structures Visitor pattern Systematic design technique for encapsulating operations over such structures into a single class Softw design body of knowledge Organized around a set of core principles Rigor and formality Separation of concerns Abstraction Anticipation of change Modularity S ource Generallty Fundamentals of Software Engineering 39 Crementallty by Ghezzi Jazayeri and Mandrioli Goal At end of this courseyou should be able to apply these prmcnples With pro cnency In real deSIgn contexts Quote from Edsgar Dijkstra Let me try to explain what is characteristic for all intelligent thinking It is that one is willing to study in depth an aspect of one s subject matter in isolation for the sake of its own consistency all the time knowing that one is occupying oneself only with one of the aspects We know that a program must be correct and we can study it from that viewpoint only we also know that it should be efficient and we can study its efficiency on another day so to speak In another mood we may ask ourselves whether and so why the program is desirable But nothing is gained on the contrary by tackling these various aspects simultaneously It is what sometimes have called quotthe separation of concerns quot which even not perfectly possible is yet the only available technique for effective ordering of one s thoughts that know of This is what mean by quotfocusing one s attention upon some aspect it does not mean ignoring the other aspects it is just doing justice to the fact that from this aspect s point of view the other is irrelevant t is being one and multipletrack minded simultaneously Separation of concerns SOC Very general principle of software engineering indeed any intellectual activity Suggests that we should manage complexity by separating or avoid unnecessarily mixing conceptually unrelated aspects of a problem or solution A clean separation allows each concern to be dealt with in isolation and for the composition of concerns to be well understood 00 Design is flush with patterns and idioms for separating concerns Opportunity for SOC in 00 Design Problem Program understanding when code contains interleaved strands that accomplish distinct purposes Code that implements these distinct purposes tends to be tangled together Code for a single purpose may be scattered across many classes and functions Concerns Each distinct purpose or feature Idea Manage complexity by disentangling these functionally distinct code strands Motivation Suppose we have a class hierarchy that instantiates the composite pattern Eg expressiontree hierarchy Lots of polymorphic operations that we might want to implement Eg type checking Eg pretty printing Eg evaluation Question Suppose we have an existing Expr hierarchy that supports type checking and evaluation but not pretty printing How many classes must we modify in order to add pretty printing Visitor pattern Allows addition of new polymorphic operations to a class hierarchy without modifying any of the classes Requires two hierarchies Original composite hierarchy Visitorclass hierarchy New operations implemented by specializing visitor class hierarchy More precisely Visitorclass hierarchy must have a most abstract root class Every class in the subject hierarchy provides a polymorphic accept operation which takes a reference to the visitorhierarchy root class as a parameter invokes a subjectclass specific method on this parameter passing itself ie the object that received the accept message as a parameter Eg the body of accept method in class X would invoke method visitX on visitor object passing this as a parameter Example Expression Visitor class ExprVisitor public virtual void visitLiteralExprLiteralExpr virtual void visitAddExprAddExpr virtual void visitVarExprVarExpr virtual void visitSubtractExprSubtractExpr Accept operation class Expr public virtual Expr virtual void acceptExprVisitorampO protected Expr class LiteralExpr public Expr public virtual void accept ExprVisitoramp v vvisitLiteralExprthis Accept operation continued class AddExpr public Expr public void accept ExprVisitoramp v protected Expr left Expr right void AddExpraccept ExprVisitoramp v left gtacceptv right gtacceptv vvisitAddExprthis Example Evaluation visitor class EvaluateVisitor public ExprVisitor public double getValue void visitLiteralExpr LiteralExpr void visitVarExpr VarExpr void visitAddExpr AddExpr void visitSubtractExpr SubtractExpr protected stackltdoublegtr valStack Evaluation visitor continued void EvaluateVisitorvisitLiteralExpr LiteralExpr l valStackpushl gtvalue void EvaluateVisitorvisitAddExpr AddExpr a double rightValvalStacktop valStackpop double leftValvalStacktop valStackpop valStackpush leftVal rightVal Inclass activity Suppose we have Expr e new AddExpr new LiteralExpr5 new LiteralExpr4 Draw a UML sequence diagram that depicts the execution of EvaluationVisitor ev e gtacceptev Sequence diagram notation opera unE c a crealeC arg apem onE m n exacute order resukT msultv g L5 anunncn dlagmm mm msam mm Many apnhcmmns have a m or amqu am nasswe mums They mm m deslmy necks Gammanew Modem and Design mm we 59mm Edmun m M chae aw Madame Hummngh SM n m m592u 4 mans Penman E uuahun m Hnynr 5mm wnr m AH mm msvvw Sequence diagram example CuslomerTable campme commwssloquot ssmca Jeva swimmer commission A gun 35 Sluunnm dlagvam wm passwn objm munncc mugmms can m m wp emenlamn m vparalms wisdomvied Modem and awn wun um sebum Ed hun my mama em m drama Humuawn SW 0 w m gzu 4 a anus Peavsm tducahun m ngm 5mm mm m AH mm msmm Inclass activity Develop a prettyprint visitor for the example Expr hierarchy


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.