Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction IS 313 4.1.2003. Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O.

Similar presentations


Presentation on theme: "Introduction IS 313 4.1.2003. Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O."— Presentation transcript:

1 Introduction IS 313 4.1.2003

2 Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O

3 Business Application Development  Business process analysis  Systems analysis  Systems integration  Change management  Information systems planning  COTS procurement  Project management  Programming

4 Goals of course  Increase breadth of Java exposure  Increase depth of programming experience

5 Breadth  Collections  JDBC  GUI  Threads  Networking  Distributed computing  XML

6 Characteristics of business applications  Need for adaptability  Part of larger systems  Large and complex

7 Emphasis  Good program design  Good programming style  Building flexibility and maintainability into the code Vectors of change!

8 Resources  Office hours CST 453 12 noon – 3 pm Tuesday  COL web site http://dlweb.cti.depaul.edu/  Course resource site http://josquin.cti.depaul.edu/~rburke/s03/is313/

9 Syllabus  Alternating Quizzes Assignments  Pre-test “homework #0”  Final 6/11

10 Grading rubric  Knowledge Program shows that you know the important Java concepts  Reasoning Program shows good design decisions  Communication Program is readable

11 Homework #0  Pre-test  Simple Java class  Main method that tests it  New? jar

12 Java command line  Running DOS command shell  Navigating to the location of your files  Running JDK programs

13 JDK programs  javac java compiler.java ->.class  java java virtual machine class name  jar java archive

14 jar  Create an archive jar cvf jar-file files

15 Issues  “current” directory in DOS shell  classpath -classpath for javac -cp for java  wildcards multiple files

16 Object-oriented programming  Class template for an object associates data structure with data manipulation  Object instance of a class  Methods “program” part of the object  Constructor special method called at creation time

17 Method signature  Consists of method name parameter types return type  Example public Baz toBaz (Bar b, Foo f)  Signature Baz toBaz (Bar, Foo)

18 Inheritance  Class is a subclass of another class All (non-private) methods and instance variables from superclass belong to subclass programmer gets computational power for “free”  Overriding Supply subclass method with same signature as superclass method

19 Interfaces  Collection of method signatures no implementation  Use establish how objects will interact  without specifying what they do A class “implements” an interface  Interfaces can inherit from others

20 Why use interfaces?  Single inheritance but multiple interfaces  Efficiency inheritance is expensive  “Loose coupling”

21 Example  class C1 implements I1  class C2 extends C1 implements I2  Which are legal? C1 o1; o1 = new I1 (); o1 = new C1 (); o1 = new I2 (); o1 = new C2 (); I1 o2; o2 = new C1 (); o2 = new C2 (); C2 o3; o3 = new C1 (); o3 = new C2 (); I2 o4; o4 = new C1 (); o4 = new C2 ();

22 Input and Output  Sources files network strings keyboard  Streams input output

23 Text input  Reading from the keyboard String s = new BufferedReader ( new InputStreamReader(System.in)).readLine();  Reading from a file String s = new BufferedReader ( new FileReader(“data.txt”)).readLine();

24 Text output  Writer  Output to file BufferedWriter w = new BufferedWriter ( new FileWriter (“output.txt”)); w.println (“foo”);

25 Actual example public void load (String filename) { BufferedReader in = null; try { in = new BufferedReader (new FileReader (filename)); } catch (IOException e) { System.err.println ("Error opening file: " + filename + " Exiting."); System.exit(-2); } String line; try { while ((line = in.readLine()) != null) { try {... do something with the line...; } catch (java.text.ParseException e) { System.err.println("Couldn't parse date: " + line); } } catch (IOException e) { System.err.println ("Error reading file " + filename + "."); }

26 StringTokenizer  Takes a string apart String text = “Whatever you want, you’ll get it.”; StringTokenizer st = new StringTokenizer (text); while (st.hasMoreTokens()) { String word = st.nextToken ();... process token... }


Download ppt "Introduction IS 313 4.1.2003. Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O."

Similar presentations


Ads by Google