1
|
- Session 2
- LBSC 790 / INFM 718B
- Building the Human-Computer Interface
|
2
|
- Questions
- The big picture
- Making java
- UML overview
|
3
|
|
4
|
- Learn some words
- Put those words together in simple ways
- Examine to broaden your understanding
- Create to deepen your mastery
- Repeat until fluent
|
5
|
- Hold a reference to an object
- Or the value of a primitive data type
- Must be declared
- Generally, done at the beginning of:
- Classes (“instance variables”)
- Methods (“local variables”)
- Inline declarations are allowed
- Local variables must be initialized!
|
6
|
- Exist without using “new”
- Referred to by the class name, not the object
- Static variables are “constants”
- Static methods can be invoked with no instance
- This is how the main method in an application works
- Static methods can’t refer to instance variables
|
7
|
- A set of elements
- For example, the number of days in each month
- Each element is assigned an index
- A number used to refer to that element
- For example, x[4] is the fifth element - count from zero
- Arrays and loops work naturally together
|
8
|
- Defining a method
- int multiplyNumbers (a, b){return a*b;}
- Argument values are local to the method
- Explicitly invoking a method
- Events invoke a method in response to a stimulus
- Mouse click, mouseover, resize window, …
|
9
|
- Java objects represent specific things
- “new” operator “instantiates” an object
- By calling a “constructor” method
- “Garbage collection” destroys objects
|
10
|
- Java classes represent types of things
- Can be thought of as blueprints for objects
- Classes =3D state + actions
- State is represented by variables
- Actions are represented by methods
- Scope rules support abstract thinking
- Public: can be used from other classes
- Private: can only be seen in the class
|
11
|
- Identify the needed types of objects
- For each object type (“class”):
- Represent the state using variables
- Represent the actions using methods
- Write the java code
- Test it using a main method
- Test the entire system
|
12
|
- A library is a collection of books
- Initially, assume just one copy of each book
- Users can check to see if a book they want is available
- Users can check out and check in books
|
13
|
- Read the Book class
- Available on the session 2 notes page
- Create the Library class
- Test the two together
- Revise the book class for multiple copies
- Test the improved system
|
14
|
- How variables are named
- How arrays are used
- How strings are used
- Modularity of methods
- How errors are handled
- How methods are invoked
- How arguments work
- How layout helps reading
- How results are passed
- How scope is managed
- How boolean flags are used
- How output is created
- How classes are defined
- How applications are invoked
|
15
|
- Systems can get more complex than people can comprehend all at once<=
/li>
- Key idea: Progressive refinement
- Carve the problem into pieces
- Carve each piece into smaller pieces
- When the pieces are small enough, code them
- UML provides a formalism for doing this
- But it does not provide the process
|
16
|
- Capturing the big picture
- Use case diagram (interactions with the world)
- Narrative
- Scenarios (examples to provoke thinking)
- Designing the object structure
- Class diagram (“entity-relationship” diagram)
- Object diagram (used to show examples)
|
17
|
- Represent a candidate workflow
- Activity diagram (a “flowchart”)
- Represent object interactions for a scenario
- Collaboration diagram (object-based depiction)
- Sequence diagram (time-based depiction)
- Represent event-object interactions
- Statechart diagram (a “finite state machine”)
|
18
|
- Focusing your attention
- Design from the outside in
- Representing partial understanding
- Says what you know, silent otherwise
- Validate that understanding
- Structuring communication with stakeholders
|
19
|
- Don’t sweat the notation too much
- The key is to be clear about what you mean!
- Don’t try to make massive conceptual leaps
- Leverage abstraction encapsulation
- Don’t get to attached to your first design
- Goal is to find weaknesses in your understanding
|
20
|
- Examine the FlightFinder
- http://www.glue.umd.edu/~oard/spacea/ff/
- Identify the key actors
- Identify the use cases
- Draw a use case diagram
|
21
|
- What cool resources have you found?
- What new Java tricks have you learned?
- What do you need to know to make progress?
|
22
|
- On a blank sheet of paper, write a
- single sentence that will convey
- to me what you found to be the
- most confusing thing that was
- discussed during today’s class.
|