Plan for today Refactoring and Design Patterns

Slides:



Advertisements
Similar presentations
Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Advertisements

COP 3331 Object Oriented Analysis and Design Chapter 7 – Design by Abastraction Jean Muhammad.
Unified Modeling Language
Dept. of Computer Engineering, Amirkabir University of Tech. 1 Design Patterns Dr. Noorhosseini Introduction.
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 16 Slide 1 User interface design.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Design Patterns.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
ITEC 370 Lecture 11 Design. Review Questions? Today! –Rough draft of your SRS document –Introduction, Features (Functional / Non-functional), Interfaces.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
DESIGN PATTERNS CSC532 Adv. Topics in Software Engineering Shirin A. Lakhani.
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Programmeerimine Delphi keskkonnas MTAT Programmeerimine Delphi keskkonnas MTAT Jelena Zaitseva
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Five design principles
Design Patterns Introduction
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Class Relationships Lecture Oo08 Polymorphism. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 10 p.125 n Fowler & Scott, UML.
TEMPLATE METHOD DESIGN PATTERN -SWAPNIL SHAH. WHAT IS A DESIGN PATTERN… A design pattern is a general reusable solution to a commonly occurring problem.
Chapter 01 Introduction Introduction.
Patterns in programming
Elaboration popo.
Unit II-Chapter No. : 5- design Patterns
Concepts of Object Oriented Programming
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Design Patterns (Chapter 6 of Text Book – Study just 8)
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
MPCS – Advanced java Programming
Introduction to Design Patterns
Design Patterns C++ Java C#.
Low Budget Productions, LLC
Introduction to Design Patterns
Design Patterns C++ Java C#.
Design Patterns Damian Gordon.
Introduction To Design Patterns
Design Patterns.
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
How to be a Good Developer
object oriented Principles of software design
How to be a Good Developer
Chapter 6: Using Design Patterns
Advanced Programming Behnam Hatami Fall 2017.
Object Oriented Design Patterns - Creational Patterns
DESIGN PATTERNS : Introduction
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
Design Patterns Imran Rashid CTO at ManiWeber Technologies.
Introduction To Design Patterns
Object Oriented Design & Analysis
Introduction To Design Patterns
Design Patterns: A Place to get Design Ideas
Presentation transcript:

Plan for today Refactoring and Design Patterns What is a Quiz How do you create quiz, get quiz, use quiz What is the model, what is the view Android specific, OO Specific Understanding vocabulary, getting projects done, working in pairs and/or groups Compsci 290 compared to IRL

Java and Object-Oriented Concepts What is a class? When to use inheritance? Class encapsulates state and behavior State is instance variables Behavior is public/exported methods: API Inheritance models "is-a" Liskov Substitution Principle Given pointer/reference to Foo, replace with any subtype/subclass and everything works (beware of Rectangle/Square)

Quiz Differences What are the differences in 2 and 4 question quizzes from Model perspective A quiz is not part of a view here, it's a model/part of a model Is this state difference of a behavior difference? How might you capture the differences? Subclassing? Changing public methods of Quiz/Question?

Conceptual and Practical Refactoring Design and Implementation: iterative Think first, code later? Code first, think later? Think, code, think, code, … repeat until done What is a Quiz? Think about this from both programmatic and non-programmatic views Do programs model real-world expectations?

Refactoring Ideas Question class: state and behavior What is a Quiz? What is a question? Ideas for two/four answer question Who (what) creates a Question? What is a Quiz? What was a QuizGenerator in original program, what are flaws with that design? What might be source of quiz? Should user have choice of quizzes? How?

Design Pattern In software engineering, a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. https://en.wikipedia.org/wiki/Software_design_pattern

Personal Pattern Odyssey

Creational Patterns Factory: https://en.wikipedia.org/wiki/Factory_method_pattern What kind of Quiz will we use, source of questions rather than behavior, e.g., JSONQuiz, SQLQuiz, … Creation of quiz types deferred to factory, ask the factory for the quiz Abstract Factory and Singleton classes What is source of factory, e.g., web-based, SQL-based, internal Don't permit creation, e.g., singleton class

What about the View? How will we display multiple answers to user as part of Quiz? Some concepts and ideas that might help? Android concept of Fragment: part of Activity, but not a separate Screen, e.g., swappable on the same screen Android concept of ListView, e.g., see documentation: https://developer.android.com/guide/topics/ui/layout/listview.html Simple? Just create two or four buttons?

Future Considerations Questions displayed as images rather than strings: design and coding impact? How do you know what correct answer is? Do you query button for state? Other mechanisms? Source of Quiz Questions Once Quiz created, is question the same? Is ImageQuestion different? Is QuizGenerator/QuizFactory Different?

Loading Quizzes/Questions What might issues be in creating or using different Quiz/Questions sources, e.g., web, sql, other? How will you manage some of these issues? How will you know what Android provides versus what you create yourself? Loaders: https://developer.android.com/guide/components/loaders.html

Adding Functionality to QuizMaster https://gitlab.oit.duke.edu/ola/quizmaster Branch is multi-questions Walk through refactoring changes to Quiz, Question, QuizGenerator Java-isms Static initializers: purpose Android-isms Static naming conventions What's left? Many things 