Title: User Interface Software, Architecture, and Implementation
1User Interface Software, Architecture, and
Implementation
- Loren Terveen
- CS 5115, Fall 2008
- November 24
2Objectives for today
- Introduce key UI Software / Implementation
concepts - Preview two classes from next semester
3Deliverables for next week
- Change List
- Presentation Plans
4Exam Review
5Classic UI Software Concepts
- Widgets
- Layout management
- Event Handling
- Model-View-Controller Architecture
- Toolkits
6Well look at these concepts through
- Visual Basic .NET
- Visual interface builder scripting language to
associate behaviors with graphical objects - Java/Swing
- Powerful, high-level programming language with
integrated GUI constructs
7Object-orientation
- Most powerful UI toolkits are object-oriented
8Quick review of widgets
- Software input devices
- All UI toolkits provide a basic set they are
the building blocks for user interfaces - Standard types include
- Buttons
- Sliders
- Menus
- Lists
- Text Boxes
- Multi-Values
- Containers
9Automated Layout Management
- Placing widgets in the desired position
- Specifying how much space they get
- Specifying resize behavior
10The home of automated layout management
- Java/Swing http//java.sun.com/docs/books/tutoria
l/uiswing/layout/index.html - Tcl/Tk
- From simple grids to complex constraint systems
- Contrast to systems where layout is done
manually, e.g., Visual Basic
11Events - The Basics
- Events happen they must be noticed, then
handled - A contrast to traditional top-down sequential
flow - Examples
- User input
- Button clicked
- Mouse dragged
- Enter key pressed
- Etc.
- External programs
- Timers
- Observe that events are
- Discrete software gets notified after an event
happens - Unambiguous there is no doubt which event happens
12VB .NET
- Illustrate, including showing how event handlers
are defined
13Key Architectural Concept
Model-View-Controller
- Developed as part of the Smalltalk language
- Cleanly separates three aspects of user interface
programming - Model the application data, or state
- View screen presentation, what the user sees
and interacts with, the look - Controller defines how events are handled, the
feel - See Olsen, Figures 1.3 1.7
14MVC Communication
data for rendering
Model
View
events
updates
Controller
15Lets look at Windows Explorer
16Explorer Details View
17Explorer Icons View
18Explorer Thumbnails View
19MVC in Windows Explorer
- Windows Explorer
- Model a set of files
- Views Large Icons, Small Icons, List, Details,
Thumbnails - Controller how actions such as mouse clicking
and dragging are interpreted - Note some actions just change an individual
view, others change the shared model
20MVC in Swing
- View and controller are combined
- http//java.sun.com/docs/books/tutorial/uiswing/co
mponents/model.html - Converter
- Shared Model Demo
21Advantages of MVC (1)?
- Decreases coupling
- Simplifies complex user interface code
- Multiple controllers may be defined based on
desired behavior - Changes to part can affect others without
requiring the changed object to know details of
others - Increases Cohesion
- Only the view is concerned with pixels and
screen-based data
22Advantages of MVC (2)?
- Improved Flexibility
- New views can be added without changing model
- Increases Reuse
- One model can be represented in several ways
23Advantages of MVC (3)?
- Multiple, automatically synchronized views
- Views and controllers often provided by toolkit
- Application developers may create new views and
controllers if needed - Very helpful for multi-user applications
24Disadvantages of MVC
- Introduces some complexity
- More classes
- More abstractions
- Since its a conceptual definition, not a
specification - Means different things to different people
- Different instantiations in different toolkits
25Thats (part of) the desktop GUI implementation
story, but
- Software toolkits evolved with and are based on a
particular hardware platform - High resolution, bitmap displays pointing
devices - Toolkits promote consistency, which benefits end
users
26How do things differ when you create a
- Web-based UI?
- Collaborative / multi-user UI?
- Ubiquitous computing app
- Very large or small displays different input
devices - Recognition-based interface (e.g., speech
recognition)? - event loop may not make sense
27Key desktop metaphor Direct Manipulation
- Shneiderman
- Continuous representation of the object of
interest - Physical actions or labeled button presses
instead of complex syntax - Rapid incremental reversible operations whose
impact on the object of interest is immediately
visible - Examples
28Web-based UIs
- The classic web approach
- Newer approaches / frameworks, e.g., AJAX,
Springs, Strut, Ruby on Rails, Flex
29Web 1.0 interaction (Form)?
Compare/contrast appearance/interaction to
desktop GUIs, such as Swing
30Web page, showing results
31Old web programming model
4. Prints response to stdout, eventually exits
Application Program (CGI)?
3. Data passed via stdin and/or environment
variables
HTML Document
Server
5. New html document sent to browser
Client
Web browser (typically displaying a form)?
3. Script name form data sent to server
USER
Contrasts and Issues?
32AJAX
- Set of techniques for making web pages more
interactive - More work done on the client side
- Google popularized this with Google Suggest and
Google Maps lets look at them
33Flash/ActionScript (Flex)?
34CS 5125 Collaborative and Social Computing
- Theory, applications, technology, and methods
- Readings
- Likely topics wikis, blogs, social networking,
open source software, mmporgs, recommender
systems, work studiesLectures Discussion - Assignments
355980 (Prof. Riedl's section)?
- Designing the Interactive Web
- Systems-oriented
- Programming Languages for web UI toolkits
36Your project
- What implementation platform did you select?
- Why?
- Pros and cons of your choice
- Discuss in inter-project groups