Structured Programming and UML Introduction Session 2 LBSC 790 / INFM 718B Building the Human-Computer Interface
Agenda Introductions Logistics Review & questions Working with Java UML introduction (time permitting) Team project
Software development process Development process models Requirements discovery Design specification Rapid prototyping
Rapid Prototyping + Waterfall Update Requirements Choose Functionality Build Prototype Initial Requirements Write Specification Create Software Write Test Plan
Rapid prototyping process Evaluate Refine Design Specification Identify needs/ establish requirements Build Prototype Final specification Exemplifies a user-centered design approach Start
Working with Java Source code & class files Statements Variables Expressions & operators Classes Arrays
Objectives Edit, compile and execute simple Java programs Use command line and Eclipse
Language Learning Learn some concepts & words Put words together in simple ways Examine to broaden understanding Create to deepen mastery Reflect to gain insight Repeat until fluent
The Big Picture ??
The Java Virtual Machine Java Compiler (javac) Java Virtual Machine (java) Java Source Code bytecode Keyboard Mouse Screen Speaker Network “compile time”“run time” Java Class File pseudo- english
Making Java Applications Start by defining a top-level class public class ExampleApplication { … } Create a main method in the top-level class public static void main(String[] args) { … } Put statements in the main method System.out.println(“Hello World!”); Add more methods to the class as needed Add more classes as needed
Getting the Java SDK to Work path –Where to look for javac, java, … classpath –Where to look for “.class” files Both can be set automatically –On WAM and Glue, “tap java” –On Windows: Control Panel->System->Advanced->Environment Variables
Statements in Java Sequential {…; …;…;} Semicolons are required at the end of every statement Conditional if (i==3) {…} else {…} Loop for (i=0;i<10;i++) {…} while (i<5) {…} Braces are optional around a single statement
Variables 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!
Operators in Java Arithmetic operators + - * / Logical operators = > && || ! String operator +
Arrays in Java 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
Team Project Designed for teams of three people –Larger or smaller is okay, working alone is not Form team, choose goal by week 6 –Plan on 6 hours per person per week after that –Choose one of sample project ideas, or invent your own –See:
Team Project Go through three prototype iterations –2 weeks each (=36 person-hours to design/code/test) Make a presentation during the final class session
Coming up Exercise 2 will be revised & posted Friday noon Start thinking about projects Next week: –Modular programming –UML use case models
Muddiest Point 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.