Slide design: Dr. Mark L. Hornick

Slides:



Advertisements
Similar presentations
SE2811 Week 8 Monday (last drop day) The Command Pattern Lambda Expressions SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr.
Advertisements

SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
CS2852 Week 8, Class 2 Today Tree terminology Non-Binary and Non-Search Trees Tree Traversals (Remaining slides not yet shown) Tomorrow: Quiz Implementing.
Week 5, Day 3: Observer Today Reducing coupling with the Observer The Observer pattern in Java APIs Posting events to a UI worker thread SE-2811 Slide.
SE-1021 Software Engineering II Week 5, Class SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
SE2811 Week 7, Class 1 Composite Pattern Applications Conceptual form Class structure Coding Example Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark.
SE-1021 Software Engineering II Week 8, Class 1 Return Exam Producing UML diagrams automatically in EA Poll Everywhere Files Tomorrow Week 6 HW due (if.
SE-1021 Software Engineering II Week 5, Class 2 Why my computer crashed Layouts Multiple action listeners Single actionPerformed method – distinguishing.
Week 2, Day 2: The Factory Method Pattern Other good design principles Cohesion vs. Coupling Implementing the Strategy Pattern Changing strategies (behaviors)
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
CS-2852 Data Structures Week 5, Class 2 – Testing and Stacks Announcement: Lab Demos - 2/3 & 4 on Friday Testing  Definitions, Example  (tentative) Testing.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE-1021 Software Engineering II Week 1, Day 2 Attendance Survey results: Use powerpoint Safety Review Preparation for Lab 1 More on Java fundamentals…
SE1011 Week 8, Class 3 Today Designing Code SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1.
CS2852 Week 6, Class 1 Today The run-time stack Writing and proving recursive methods SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
SE1011 Week 5, Class 1 Today More Java API tools Packages Object Oriented Programming Muddiest Point Tomorrow: Lab 5 – In-lab demo requirements now up.
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
Week 3, Day 3: Singleton Pattern Quiz Status Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick.
Week 7, Day 3 Half-Exam 2 A New Pattern SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2852 Week 6, Class 2 Today Class exercise: Implementing a recursive method Binary Search Trees Tomorrow: Quiz at start of lab Implementing a recursive.
Week 5, Day 3: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
CS2852 Week 3, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
Slide design: Dr. Mark L. Hornick
Week 10, Day 3 Review for the quarter SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2910 Week 7, Class 1 Today Capturing SMTP with Thunderbird Tomorrow Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
SE2811 Week 8 – Class 2 Re: Lab due tonight SE-2811 Slide design: Dr. Mark L. Hornick Much Content: Dr. Hornick Most Errors: Dr. Yoder 1.
SE3910 Week 8, Class 3 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 9 Lab: Individual demos of working sub-modules.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide style: Dr. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
SE-2811 Software Component Design
SE-2811 Software Component Design
Week 6, Class 2: Observer Pattern
SE-2811 Software Component Design
SE-1021 Software Engineering II
Week 7, Class 1: The Command Pattern (cont.)
SE-2811 Software Component Design
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
7. Decorator SE2811 Software Component Design
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Week 6, Class 2: Observer Pattern
Slide design: Dr. Mark L. Hornick
Polling vs. Interrupts CS2852 4/21/2019
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
CS-2852 Data Structures Week 1, Class 1 Data Structures Syllabus
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
Presentation transcript:

Slide design: Dr. Mark L. Hornick SE-2811 5/23/2018 Week 6, Day 2: Decorator Review Muddiest Points for Quarter Decorators Muddiest Point Tomorrow: Direct Supply tour with Kent Newbury Demos of (hopefully working) labs Lab due in the evening No new lab this week. SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder Dr. Yoder

SE-2811 5/23/2018 Muddiest Point See Muddiest Point Table online: slides/se2811-6-2-MuddiestPoint.xlsx (and on my machine) SE-2811 Dr. Mark L. Hornick Dr. Yoder

How are decorators useful? CS-1020 5/23/2018 How are decorators useful? Decorators have the same super-type as the objects they decorate. One or more decorators can be used to wrap an object. One answer to question 1: Given that the decorator has the same super-type as the object it decorates, we can pass around a decorated object in place of the original (wrapped) object. One answer to question 2: Objects can be decorated at any time, so we can decorate objects at runtime with as many decorators as we like. Helps organize: e.g., can put all beverage objects in the same data-structure Used when initializing super-class Why is this useful? Can still get to specific & useful method When creating the object By casting back to cream (leaves open question: Is it cream?) Test using instanceof Can get more & more specific about the object with multiple decos. Don’t need all the classes for all combinations Dr. Mark L. Hornick

Downsides What are the disadvantages of decorators? SE2811 5/23/2018 Downsides What are the disadvantages of decorators? See interview drama on p. 104 in the text (Head First) Large number of small classes overwhelming to new developers Problem when people rely on specific types without thinking through [TODO: Study & find example] e.g. Consider the mess if the interface does not already exist for the class Complexity of wrapping many to construct a new one SE-2811 Dr. Mark L. Hornick Dr. Josiah Yoder

Forced selection: Do you like Java's I/O? Yes / No 5/23/2018 Forced selection: Do you like Java's I/O? Yes / No SE-2811 Dr. Mark L. Hornick Dr. Yoder

Join those who agree with you in defending your position! 5/23/2018 Join those who agree with you in defending your position! I like Java's I/O decorators I don't like Java's I/O decorators SE-2811 Dr. Mark L. Hornick Dr. Yoder

Alternative Decorator Designs SE-2811 5/23/2018 Alternative Decorator Designs x SE-2811 Dr. Mark L. Hornick Dr. Yoder

How to create a car with a sunroof and radio? SE-2811 5/23/2018 How to create a car with a sunroof and radio? SE-2811 Dr. Mark L. Hornick Dr. Yoder

Decorator vs. Array of Add-ons SE-2811 5/23/2018 Decorator vs. Array of Add-ons What is the advantage of using your pattern? SE-2811 Dr. Mark L. Hornick Dr. Yoder

Decorator vs. Array of Add-ons SE-2811 5/23/2018 Decorator vs. Array of Add-ons SE-2811 Dr. Mark L. Hornick Dr. Yoder

Downsides What are the disadvantages of decorators? SE2811 5/23/2018 Downsides What are the disadvantages of decorators? See interview drama on p. 104 in the text (Head First) Large number of small classes overwhelming to new developers Problem when people rely on specific types without thinking through [TODO: Study & find example] e.g. Consider the mess if the interface does not already exist for the class Complexity of wrapping many to construct a new one SE-2811 Dr. Mark L. Hornick Dr. Josiah Yoder

https://www.polleverywhere.com/free_text_polls/zIp2tH2IVWjXv4H SE-2811 5/23/2018 Muddiest Point SE-2811 Dr. Mark L. Hornick Dr. Yoder

Threading Muddiest Point [To be revisited in a future lecture] SE-2811 5/23/2018 Threading Muddiest Point [To be revisited in a future lecture] All lambda examples the same code? Lambda examples When would you use a Lambda expression over an anonymous class and vice versa? Lambda vs. Anon inner syntax The Lambda is a Java thing, not an intelliJ thing right? Java 8 whens the next quiz? Quiz Agree More examples of using lambdas (didn't get exposure in software dev 2) Effectively Final? "Effectively Final" SE-2811 Dr. Mark L. Hornick Dr. Yoder

Patterns Muddiest Point [To be revisited in a future lecture] SE-2811 5/23/2018 Patterns Muddiest Point [To be revisited in a future lecture] We really didn't cover any sorting algorithms and what each's benefits are Can we do an example??? Related to the quiz for below question Do we need to implement code versions of the strategy and factory method patterns?? If so how extensive and will it be similar to how we implemented in class? Implementing the methods needed for the factory method pattern. Is there a flowchart/checklist to determine which pattern is more appropriate to use? Choosing the correct design pattern What are Coupling and Cohesion and is it better to have high or low coupling or cohesion? On a quiz/test would you ask us to draw the uml of a particular general pattern, or would you just ask us to write the code? Why would we use Factory Pattern? How do you know when to use what pattern to solve a problem? Diagrams High/Low Cohesion/Coupling Class Diagram for Factory Design Pattern Nothing Dr. Yoder

Decorator vs Strategy SE-2811 5/23/2018 Dr. Yoder SE-2811 Dr. Mark L. Hornick Dr. Yoder