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.
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.
Week 2, Day 2: The Factory Method Pattern Other good design principles Cohesion vs. Coupling Implementing the Strategy Pattern Changing strategies (behaviors)
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1 Class 1-2.
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
SE-2811 Software Component Design Week 1, Day 2 (and 1-3 and 2-1) SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1.
SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide.
SE1011 Week 6, Class 2 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) UML class diagrams Muddiest Point Next Half Exam: Week 7, Monday.
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 6, Class 2 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) UML class diagrams Muddiest Point Next Half Exam: Week 7, Monday.
CS2910 Week 10, Class 1 Today Modular Arithmetic RSA Week 10, Monday Quiz: Potential topics TCP window size & header format Public/private key encryption.
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.
More Patterns CS 124. More Basic Patterns Patterns you’ve already seen (without knowing it) Observer / Listener Wrapper Composite Decorator / Filter Patterns.
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.
SE-2811 Software Component Design Week 1, Day 2 Making teams Warm-up exercise Design pattern defined SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick.
SE-1021 Software Engineering II Week 9, Class 1 ByteBuffer Tomorrow Get quizzes back from last week… Wednesday Quiz at start of lab 1.
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:
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 3, Day 2: Patterns Review & New Pattern Return Quiz 1 (I have it with me) Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr.
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.
The Decorator Pattern Decorators in Java I/O classes SE-2811 Dr. Mark L. Hornick 1.
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
Week 2, Day 1: The Factory Method Pattern
SE-2811 Software Component Design
SE-2811 Software Component Design
Model-View-Controller
SE-2811 Software Component Design
SE-2811 Software Component Design
SE-1021 Software Engineering II
OO Design Patterns - Decorator
Week 7, Class 1: The Command Pattern (cont.)
SE-2811 Software Component Design
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
7. Decorator SE2811 Software Component Design
7. Decorator, Façade Patterns
SE2811 Software Component Design Dr. Rob Hasker
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
SE-2811 Software Component Design
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
SE-1021 Software Engineering II
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Software Development Techniques
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
Presentation transcript:

Slide design: Dr. Mark L. Hornick SE-2811 5/6/2019 Week 6, Day 1: Decorator Return Half-Exam 1 & Quiz 4 (I have them with me) Decorators Muddiest Point SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder Dr. Yoder

HW SE-2811 5/6/2019 By Monday at 10am, email to me a Writer decorator that implements a Caesar cipher. The user should supply an integer key when creating the wrapper The CaesarWriter should add the key to the value of each character that is written to the stream. If the value goes above 255, it should wrap around through 0. Be sure to include the template write(String str, int off, int len) from ScrambleWriter We will run and debug your code in class. Dr. Yoder

(Review) (Byte) Output Streams SE-2811 5/6/2019 (Review) (Byte) Output Streams Byte output stream (with other Variables…) SE-2811 Dr. Mark L. Hornick Dr. Yoder

(Review) (Char) Writers SE-2811 5/6/2019 (Review) (Char) Writers OutputStreams write (8-bit) bytes. Writers write 16-bit Unicode code-points You can wrap a PrintWriter around a PrintStream You cannot wrap a PrintStream around a PrintWriter (unless you write the code yourself.) TODO: Copy some of the really cool code-points students found last year SE-2811 Dr. Mark L. Hornick Dr. Yoder

In-class exercise: Modify the code to de-scramble the stream 5/6/2019 In-class exercise: Modify the code to de-scramble the stream Writer writer = new ScrambleWriter(new StarInserter(new PrintWriter( System.out)))); //------- Your code here: --------- //------- End your code ---------- PrintWriter printWriter = new PrintWriter(writer,true); SE-2811 Dr. Mark L. Hornick Dr. Yoder

Design Principles T/? Reduce coupling T Increase cohesion 5/6/2019 Design Principles T/? Reduce coupling T Increase cohesion T Encapsulate what varies T Favor composition over inheritance T Program to interfaces, not implementations T Classes should be open for extension but closed for modification Which of these are met? (Avoid coupling) Strive for loosely coupled designs between objects that interact SE-2811 Dr. Mark L. Hornick Dr. Josiah Yoder

Downsides What are the disadvantages of decorators? SE2811 5/6/2019 Large number of small classes overwhelming to new developers Problem when people rely on specific types without thinking through [TODO: Study & find example] Complexity of wrapping SE-2811 Dr. Mark L. Hornick Dr. Josiah Yoder

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

Threading Muddiest Point [To be revisited in a future lecture] SE-2811 5/6/2019 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/6/2019 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