Basic Organization of UI Software. 2 The User Interface n Typically want to think of “UI” as only one component of an overall system – The part that “deals.

Slides:



Advertisements
Similar presentations
Going Beyond Conventional GUIs. 2 Changing the assumptions n What happens when we step outside the conventional GUI / desktop / widgets framework? – Topic.
Advertisements

CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
CS 106 Introduction to Computer Science I 11 / 26 / 2007 Instructor: Michael Eckmann.
Introduction To System Analysis and Design
Inheritance. Extending Classes It’s possible to create a class by using another as a starting point  i.e. Start with the original class then add methods,
1 Model View Controller. 2 Outline Review Definitions of MVC Why do we need it? Administiriva Changing the display Event flow Dragging at interactive.
CS 106 Introduction to Computer Science I 04 / 16 / 2010 Instructor: Michael Eckmann.
Basic OOP Concepts and Terms
CS 201 Functions Debzani Deb.
Object-oriented Programming Concepts
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
Systems Analysis I Data Flow Diagrams
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Unified Modeling Language
BACS 287 Basics of Object-Oriented Programming 1.
UNIT-V The MVC architecture and Struts Framework.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Introduction To System Analysis and design
Access Control Problem A primary consideration in object- oriented design is to “separate the things that change from the things that stay.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Software Construction Lecture 10 Frameworks
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Welcome to CIS 083 ! Events CIS 068.
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
1 Implementation support chapter 8 programming tools –levels of services for programmers windowing systems –core support for separate and simultaneous.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
Software Development. Software Developers Refresher A person or organization that designs software and writes the programs. Software development is the.
GUIs in Java Swing, Events CS2110, SW Development Methods Readings: MSD, Chapter 12 Lab Exercise.
3461 Model-View Controller Advanced GUI concepts.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Example: object diagram for Scheduler, v What is wrong with this diagram? Seems like a lot of similarity between Task and UnplannedTask Can use.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Design Model Lecture p6 T120B pavasario sem.
Model View Controller MVC Web Software Architecture.
Toolglasses and Magic Lenses. 2 Reading: Eric A. Bier, Maureen C. Stone, Ken Pier, William Buxton and Tony D. DeRose, “Toolglass and magic lenses: the.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Morphic A highly unusual graphical toolkit! Originates in the Self project at Sun –Self: a prototype-based programming language –No classes---objects inherit/instantiate.
Behavioural Design Patterns Quote du jour: ECE450S – Software Engineering II I have not failed. I've just found 10,000 ways that won't work. - Thomas Edison.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Lecture VIII: Software Architecture
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Fusion Design Overview Object Interaction Graph Visibility Graph Class Descriptions Inheritance Graphs Fusion: Design The overall goal of Design is to.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Duke CPS Programming Heuristics l Identify the aspects of your application that vary and separate them from what stays the same ä Take what varies.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
COMPOSITE PATTERN NOTES. The Composite pattern l Intent Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Object-Oriented Design
Support for the Development of Interactive Systems
Architecture Concept Documents
System Design and Modeling
Tkinter GUIs Computer Science and Software Engineering
Week 13: Wrap-up Refining Class Diagram and Implementation
Fundaments of Game Design
Basic OOP Concepts and Terms
Week 15: Refining Class Diagram and Implementation
Presentation transcript:

Basic Organization of UI Software

2 The User Interface n Typically want to think of “UI” as only one component of an overall system – The part that “deals with the user” – Distinct from the “functional core” (AKA the “application”)

3 Separation of UI from “Appl” n Really good reasons to want separation of UI (In general want “separation of concerns”) – Modularity (good software design) – Different expertise needed – Don’t want to iterate the whole thing

4 Unfortunately this is typically very hard to do in practice n More and more of interactive programs are tightly coupled to UI (in some cases everything) – Generally need to structure around user concepts – UI structure “sneaks into” application – Tight coupling can offer benefits to user (better feedback)

5 Separation of concerns is a central theme of UI organization n A continual challenge n A continual tension and tradeoff n Real separation of UI from application is almost a lost cause

6 UI tasks n So far have: n Clearly there is more structure UI Appl

7 UI tasks n Basic parts of UI Appl Input Output Appl Inter UI Core

8 UI tasks n Basic flow (later: Norman’s Diagram) Appl Input Output Appl Inter

9 How do we connect these disparate parts into working whole n Tempting to architect systems around these boxes – One module for input, one for output, etc. – Has been tried (“Seeheim model”) Didn’t work real well

10 Architectures with “3 big boxes” don’t work well because... n Modern (“direct manipulation”) interfaces tend to be collections of quasi-independent agents – Each “object of interest” is separate – e.g. a button F produces “button-like” output F acts on input in a “button-like” way F etc.

11 Leads to object-based architecture n Each object implements each aspect – In a way that reflects what it is n Objects organized hierarchically – Normally reflecting spatial containment relationships è“Interactor trees”

12 Challenge: separation of concerns n Challenge is doing all this different stuff in a single object without creating a hopelessly large and complicated beast – Will see strategies later – Basically will use O-O techniques to manage complexity

13 Tasks again in more detail (roadmap of topics) n Core functions (cross cutting) – Hierarchy management F Again: will be trees of objects – Geometry management F coordinate systems F bounds – Object status / information management

14 Tasks again in more detail n Output – Layout F establishing size and position of each object – (Re)drawing – Damage management F knowing what needs to be redrawn – Localization & customization

15 Tasks again in more detail n Input – Picking F Figuring out what objects are “under” a screen point – Event dispatch, translation, handling F A lot of the work is in here

16 Tasks again in more detail n Application interface – Won’t actually have a lot to say about this

17 Example: subArctic n All functions of an interactive object encapsulated in a base class – The “interactor” interface (API), and – The “base_interactor” class F All objects on the screen inherit from this base class n Again: interactor == control, widget, component, container in other systems

18 Standard object-oriented approach n Base class (or interface) defines the set of things that every object must do n Subclasses provide specific specialized implementations – e.g., do the right drawing, input, etc. to be a button vs. a slider vs. a column

19 interactor API defines methods for – Hierarchy management – Geometry management – Object status / info management – Layout – (Re)drawing – Damage management – Picking

20 In subclasses and other parts of the toolkit: n Input dispatch and handling n Application interface – Via “callbacks” n subArctic does not really support internationalization / customization

21 Hierarchy management…

22 subArctic interfaces are trees of interactors n To make something appear on the screen you must add it to the tree n SA takes care of many details from there – Screen redraw – Input dispatch top_level column button

23 Hierarchy management n interactor API provides methods for interactor tree manipulation – parent(), child(I), num_children() – add_child(), remove_child(), … – move_child_to_top(), … n Debugging hint: if nothing shows up on the screen, check that you added it to the tree.

24 Geometry management n Every interactor maintains its own geometry – Bounding box: x(), y(), w(), h() F x,y is relative to parent F i.e., 0,0 is at parent’s top-left corner – All drawing happens within that box F System clips to bounding box F Including output of children! – Drawing is relative to top-left corner F Each interactor has own coord system

25 Object status / information n Each interactor maintains information about its “state” – visible(), enabled() n Each keeps application info – user_info(), set_user_info() – Hint: will need this for project 1

26 Each object handles: n Layout (later…) n Drawing – Each object knows how to (re)create its appearance based on its current state F draw_self() which calls draw_self_local() (which you write) F draw_children() F This is the only way to draw on the screen!!

27 Each object handles: n Damage management – Tell the system that something about your internal state has changed and your image may not be correct – damage_self() n Picking – Determine if a point is “inside” or “over” – picked_by(x,y) F In local coordinates of the object

28 Other parts n Input (will talk about later…) n Application interface – Not in interactor, but there is a convention for “callbacks” that all use F “Application” object registers with the interactor and says “call me when something happens”

29 Callback n All objects receiving callbacks must implement the callback_object interface – One method: callback() – Gets called upon user action F Parameters indicate what happened F Application responds by…

30 Callback n All objects receiving callbacks must implement the callback_object interface – One method: callback() – Gets called upon user action F Parameters indicate what happened F Application responds by modifying the interactor tree

31 Lots of parts, but… n Base classes (base_interactor and base_parent_interactor) provide many default implementations – e.g. pick() which calls picked_by() which just tests for inside bounds – e.g. draw_self() sets up local coordinate system, clipping, etc. and calls draw_self_local() n subArctic motto: “It just works”

32 Lots of parts, but… n Only have to implement the specialized parts – Typically draw_self_local() and input n But can implement many different things to get custom behavior!

33 Practical subArctic details…

34 subArctic conventions n Uses names_like_this n All instance variables are protected – named: _variable – read with:variable() – write with:set_variable(value);

35 Let’s build an interface...

36 How does Java find subArctic (or any.class files it needs)? n Simple mapping from names to locations – Needed for operation on the web n Each class has two parts – Package it is in (from package decl) – Class name within that package (from class declaration)

37 Mapping from file system to classes n Packages map to directories – sub_arctic.lib package maps to …/sub_arctic/lib directory n Classes map to files – interactor maps to interactor.class – which is normally created from interactor.java

38 CLASSPATH n But where is “…” in “…/sub_arctic/” – System starts looking for package directories in a fixed set of places – The places listed in your CLASSPATH – “:” separated list on Unix, “;” on Windoze – System looks inside those directories to find package directories

39 CLASSPATH n Note: package directories themselves never go in CLASSPATH – The directory that contains package directories is the one listed – Suggest: only one place for Java code => only one entry in CLASSPATH

40 Problems with CLASSPATH n Compiler may let you compile, but then can’t find.class files at runtime n Make sure the thing in your CLASSPATH is the directory that contains the directories for your packages e.g., /java/sub_arctic/lib/interactor.class for sub_arctic.lib.interactor CLASSPATH should have “/java”

41 Problems with CLASSPATH n Did you leave out the package declaration in your source file? n “~user” is not expanded n sub_arctic.zip file in CLASSPATH n “…/myjava/sub_arctic” instead of “/myjava”

42 subArctic can be found n /teaching/05-631/sub_arctic /teaching/05-631/sub_arctic n /afs/cs.cmu.edu/project/ hudson-6/sub_arctic

43