logging in or signing up PatternTeach Cinderella Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINTLite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 104 Category: Entertainment License: All Rights Reserved Like it (0) Dislike it (0) Added: December 04, 2007 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Teaching with Patterns: Teaching with Patterns Matthias Felleisen Daniel JacksonPatterns in the Classroom: The Rice Experience: Patterns in the Classroom: The Rice Experience Matthias Felleisen Northeastern UniversityPatterns in Courses : Patterns in Courses graduate Course (fall 94/spring 95) junior-level PL course junior-level PD/FM course second-semester course Patterns in Courses : Patterns in Courses graduate Course (94) junior-level PL course junior-level PD/FM course second-semester courseRice’s Introductory Year: Rice’s Introductory Year Comp 210: Design Recipes (HtDP) majors and non-majors assumes no background uses Scheme and some Java Comp 212: Design Patterns (GoF) majors mostly (plus some C++ non-majors) assumes 210-like background uses some Scheme and JavaSlide6: Design Recipes & Some Context From Recipes to Patterns Pattern Coverage Some Exepriences 210: Design Recipes & Context: 210: Design Recipes & Context Design Recipes: Design RecipesDesign Recipes: Design Recipes radical model-view separation design “internals” of programs use “internal” data, not “external” information teacher provides view Design Recipes: Design Recipes understand classes of data representation of (external) information as data in your favorite language understand “program” as function that is triggered by events that consumes/produces data most important: connect class definition and function definitionThe Basic Design Recipe: The Basic Design Recipe data analysis and class definition contract, purpose statement, header in-out (effect) examples function template function definition testing, test suite development From Class Definitions to Function Templates: From Class Definitions to Function Templates the structure of class definitions the structure of function templatesDesign Recipes: Class Definitions: Design Recipes: Class Definitions use rigorous language, not formalism naïve set theory basic sets: numbers, chars, booleans intervals (labeled) products, that is, structures (tagged) unions self-references mutual references vectors (natural numbers)Design Recipes: Class Definitions (2): Design Recipes: Class Definitions (2) (define-struct spider (name size legs)) A spider is a structure: (make-spider symbol number number)Design Recipes: Class Definitions (3): Design Recipes: Class Definitions (3) A zoo animal is either a spider an elephant a giraffe a mouse … Each of these classes of animals has its own definitionDesign Recipes: Class Definitions (4): Design Recipes: Class Definitions (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) Let’s make examples: empty (by definition) (cons (make-spider ‘Asterix 1 6) empty) (cons (make-spider ‘Obelix 99 6) (cons … …))Design Recipes: Class Definitions (5): Design Recipes: Class Definitions (5) (define-struct child (name father mother)) A family tree is either ‘unknown (make-child symbol a-family-tree a-family-tree-2) Many, if not most, interesting class definitions are self-referential. Design Recipes: Function Templates (Structure): Design Recipes: Function Templates (Structure) a function template reflects the structure of the class definitions this match helps designers guide the process readers comprehend teachers diagnose weaknesses modifiers/maintainers analyze or change Design Recipes: Templates (2): Design Recipes: Templates (2) is it a basic class? is it a union? is it a structure? is it self-referential? “domain knowledge” case analysis extract field values annotate for recursion Design Recipes: Templates (3): Design Recipes: Templates (3) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) … ) is it a union? Design Recipes: Templates (4): Design Recipes: Templates (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ <<condition>> <<answer>> ] [ <<condition>> <<answer>> ])) what are the sub-classesDesign Recipes: Templates (5): Design Recipes: Templates (5) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) <<answer>> ] [ (cons? a-loZA) <<answer>> ])) are any of the potential inputs structures? Design Recipes: Templates (6): Design Recipes: Templates (6) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) is the class definition self-referential? Design Recipes: Templates (7): Design Recipes: Templates (7) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Design Recipes: Defining Functions : Design Recipes: Defining Functions templates remind beginners of all the information that is available which cases which field values, argument values which natural recursions are computed the goal of function definitions is to compute with the available values to combine the computed effectsDesign Recipes: Overview: Design Recipes: Overview basic data, intervals of numbers structures unions self-reference in class description mutual references generative recursion special attributes: accumulators effects abstraction of designs Design Recipes: Conclusion : Design Recipes: Conclusion get students used to discipline from DAY ONE use scripted question-and-answer game until they realize they can do it on their own 212: From Recipes to Patterns: 212: From Recipes to Patterns Design Patterns : Design Patterns introduce Java use design recipes to organize classes and methods explain code as instances of design patterns Scheme to Java: Class Hierarchy: Scheme to Java: Class Hierarchy A list of zoo animals is either empty (cons animal a-list-of-zoo-animals)Scheme to Java: Code Allocation: Scheme to Java: Code Allocation ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Scheme to Java: Code Allocation: Scheme to Java: Code Allocation ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) List of zoo animals Empty: … Cons: animal list of zoo animals Interpreter Pattern (Composite)Which Patterns : Which Patterns Interpreter Composite Template and Hook Command Factory Abstract Factory (Virtual Constructor) State (and a few more on occasion)How about MVC? : How about MVC? 210 DrScheme implements MVC in REPL TeachPacks implements GUI MVC 212 DrJava implements MVC we implement MVC for students 312 Students implement MVC directly 312: Designing, and Reasoning about, Sw: 312: Designing, and Reasoning about, Sw reasonably large programs, present and discuss programs in class maintain your own code over the course of a month or two switch code, modify code of others 312: Design, and Reason about, Sw: 312: Design, and Reason about, Sw the aha course students understand why and when patterns matter the reward for going thru 212, 212Slide37: Programs have a place in the curriculum it is not in the first year (except for coding in this style). You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
PatternTeach Cinderella Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINTLite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 104 Category: Entertainment License: All Rights Reserved Like it (0) Dislike it (0) Added: December 04, 2007 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Teaching with Patterns: Teaching with Patterns Matthias Felleisen Daniel JacksonPatterns in the Classroom: The Rice Experience: Patterns in the Classroom: The Rice Experience Matthias Felleisen Northeastern UniversityPatterns in Courses : Patterns in Courses graduate Course (fall 94/spring 95) junior-level PL course junior-level PD/FM course second-semester course Patterns in Courses : Patterns in Courses graduate Course (94) junior-level PL course junior-level PD/FM course second-semester courseRice’s Introductory Year: Rice’s Introductory Year Comp 210: Design Recipes (HtDP) majors and non-majors assumes no background uses Scheme and some Java Comp 212: Design Patterns (GoF) majors mostly (plus some C++ non-majors) assumes 210-like background uses some Scheme and JavaSlide6: Design Recipes & Some Context From Recipes to Patterns Pattern Coverage Some Exepriences 210: Design Recipes & Context: 210: Design Recipes & Context Design Recipes: Design RecipesDesign Recipes: Design Recipes radical model-view separation design “internals” of programs use “internal” data, not “external” information teacher provides view Design Recipes: Design Recipes understand classes of data representation of (external) information as data in your favorite language understand “program” as function that is triggered by events that consumes/produces data most important: connect class definition and function definitionThe Basic Design Recipe: The Basic Design Recipe data analysis and class definition contract, purpose statement, header in-out (effect) examples function template function definition testing, test suite development From Class Definitions to Function Templates: From Class Definitions to Function Templates the structure of class definitions the structure of function templatesDesign Recipes: Class Definitions: Design Recipes: Class Definitions use rigorous language, not formalism naïve set theory basic sets: numbers, chars, booleans intervals (labeled) products, that is, structures (tagged) unions self-references mutual references vectors (natural numbers)Design Recipes: Class Definitions (2): Design Recipes: Class Definitions (2) (define-struct spider (name size legs)) A spider is a structure: (make-spider symbol number number)Design Recipes: Class Definitions (3): Design Recipes: Class Definitions (3) A zoo animal is either a spider an elephant a giraffe a mouse … Each of these classes of animals has its own definitionDesign Recipes: Class Definitions (4): Design Recipes: Class Definitions (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) Let’s make examples: empty (by definition) (cons (make-spider ‘Asterix 1 6) empty) (cons (make-spider ‘Obelix 99 6) (cons … …))Design Recipes: Class Definitions (5): Design Recipes: Class Definitions (5) (define-struct child (name father mother)) A family tree is either ‘unknown (make-child symbol a-family-tree a-family-tree-2) Many, if not most, interesting class definitions are self-referential. Design Recipes: Function Templates (Structure): Design Recipes: Function Templates (Structure) a function template reflects the structure of the class definitions this match helps designers guide the process readers comprehend teachers diagnose weaknesses modifiers/maintainers analyze or change Design Recipes: Templates (2): Design Recipes: Templates (2) is it a basic class? is it a union? is it a structure? is it self-referential? “domain knowledge” case analysis extract field values annotate for recursion Design Recipes: Templates (3): Design Recipes: Templates (3) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) … ) is it a union? Design Recipes: Templates (4): Design Recipes: Templates (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ <<condition>> <<answer>> ] [ <<condition>> <<answer>> ])) what are the sub-classesDesign Recipes: Templates (5): Design Recipes: Templates (5) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) <<answer>> ] [ (cons? a-loZA) <<answer>> ])) are any of the potential inputs structures? Design Recipes: Templates (6): Design Recipes: Templates (6) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) is the class definition self-referential? Design Recipes: Templates (7): Design Recipes: Templates (7) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Design Recipes: Defining Functions : Design Recipes: Defining Functions templates remind beginners of all the information that is available which cases which field values, argument values which natural recursions are computed the goal of function definitions is to compute with the available values to combine the computed effectsDesign Recipes: Overview: Design Recipes: Overview basic data, intervals of numbers structures unions self-reference in class description mutual references generative recursion special attributes: accumulators effects abstraction of designs Design Recipes: Conclusion : Design Recipes: Conclusion get students used to discipline from DAY ONE use scripted question-and-answer game until they realize they can do it on their own 212: From Recipes to Patterns: 212: From Recipes to Patterns Design Patterns : Design Patterns introduce Java use design recipes to organize classes and methods explain code as instances of design patterns Scheme to Java: Class Hierarchy: Scheme to Java: Class Hierarchy A list of zoo animals is either empty (cons animal a-list-of-zoo-animals)Scheme to Java: Code Allocation: Scheme to Java: Code Allocation ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Scheme to Java: Code Allocation: Scheme to Java: Code Allocation ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) List of zoo animals Empty: … Cons: animal list of zoo animals Interpreter Pattern (Composite)Which Patterns : Which Patterns Interpreter Composite Template and Hook Command Factory Abstract Factory (Virtual Constructor) State (and a few more on occasion)How about MVC? : How about MVC? 210 DrScheme implements MVC in REPL TeachPacks implements GUI MVC 212 DrJava implements MVC we implement MVC for students 312 Students implement MVC directly 312: Designing, and Reasoning about, Sw: 312: Designing, and Reasoning about, Sw reasonably large programs, present and discuss programs in class maintain your own code over the course of a month or two switch code, modify code of others 312: Design, and Reason about, Sw: 312: Design, and Reason about, Sw the aha course students understand why and when patterns matter the reward for going thru 212, 212Slide37: Programs have a place in the curriculum it is not in the first year (except for coding in this style).