Week 3, Day 3: Singleton Pattern Quiz Status Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. 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

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.
Week 3, Day 1: Processes & Threads Return Quiz Processes Threads Lab: Quiz Lab 3: Strategy & Factory Patterns! SE-2811 Slide design: Dr. Mark L. Hornick.
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
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 1 – Testing and Stacks Return Exams & Labs  Package-level access  UML connectors for instance variables Announcement:
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.
The Singleton Pattern SE-2811 Dr. Mark L. Hornick 1.
SE1011 Week 8, Class 3 Today Designing Code SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 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.
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
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.
CE1901 Week 6, Class 3 Week 6 Mini-Exam Review Muddiest Point Timing Diagrams (See this slide and Outcomes on course webpage – link now available)Outcomes.
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.
CS2910 Week 4, Class 2 Today Sit by someone you have not yet worked with this quarter. Learn his/her name if unknown. Turn on your laptop and start Wireshark.
Model-View-Controller A Design Pattern SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
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.
SE-2811 Software Component Design Week 1, Day 1 Design pattern defined Code that needs a design pattern… SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 8, Class 3: Model-View-Controller Final Project Worth 2 labs Cleanup of Ducks Reducing coupling Finishing FactoryMethod Cleanup of Singleton SE-2811.
Week 4, Day 1: Singleton(s?) Singleton leftover Why singletons? How to make lazy initialization work multi- threaded? Observers Why observers? Class structure.
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.
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
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
The Singleton Pattern SE-2811 Dr. Mark L. Hornick.
SE-2811 Software Component Design
SE-2811 Software Component Design
Model-View-Controller
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
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
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
14. Factory Pattern SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
Presentation transcript:

Week 3, Day 3: Singleton Pattern Quiz Status Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1

Summer Study Abroad Opportunity in St. Petersburg, Russia July 11 – 25, 2016 Two-week educational and cultural program in St. Petersburg, Russia. Curriculum is focused on the “Internet of Things (IOT)” technologies. Students will earn 3 MSOE transfer credits in CE 498 course. Online information: cooperation/summer-schoolhttp:// cooperation/summer-school Summer 2015 video: Freshmen, sophomores, juniors and even seniors are welcome to apply. Cost Tuition, room & some board, excursions – 1000 Euro Airfare ≈$ $1300 Student Visa - $300 Bank Transfer Fee - ≈ $45 - $60 (may be less) HIV Test for Student Visa – MSOE or your own doctor’s office (insurance typically covers). For all information, please Dr. Olga Imas at

Patterns Muddiest Point 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 3

Threading Muddiest Point All lambda examples the same code? [No, they weren't. see new slide] 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 Lambda examples More examples of using lambdas (didn't get exposure in software dev 2) Lambda examples Effectively Final? "Effectively Final" SE-2811 Dr. Mark L. Hornick 4

Lambda Expression Syntax Exercise: What parts does a regular method have? Lambda Expression: A variety of syntaxes are available: -> (Scanner in) -> {int x = in.nextInt(); return x+1;} (int x) -> x+1 () -> System.out.println(“hi”) x -> x+1 SE-2811 Dr. Mark L. Hornick 5

Lambda Expression Syntax Different Syntax, Same result: (int x) -> {return x+1;} (int x) -> x+1 x -> x+1 new IntInterface() { public int intMethod(int x) { return x+1; } } SE-2811 Dr. Mark L. Hornick 6

Have you ever seen a private Constructor? class Mystery { private Mystery() { /* */ } } What happens if a constructor is private? Why would you want this? SE-2811 Dr. Mark L. Hornick 7

Singleton Pattern How to use a private constructor? How to ensure only one instance is created (Single-threaded)? Again, but if multiple threads? SE-2811 Dr. Mark L. Hornick 8

Two kinds of Singletons Eager Lazy Continue coding examples SE-2811 Dr. Mark L. Hornick 9

SE-2811 Dr. Mark L. Hornick 10