Todays Summary Basic concepts of the programming language
Today’s Summary • Basic concepts of the programming language Java – Just a whirlwind introduction: • We’ll revisit each concept over the next weeks – Example: String Transformers • As examples of methods and classes • Parameters and arguments. Fields. Summarized • IDE (Integrated Development Environment) on the next few slides – Navigating JCreator. Editing in JCreator. – How to learn about classes and methods: JDK Help Fundamentals of Software Development 1 1
Classes, Instances and Fields • One class can describe many different instances • Now let’s see multiple distinct instances of a class, with local state associated with each instance – Two Name. Droppers, each with their own my. Name field Rumi Hello Maria Rumi says Hello Maria says Hello Fundamentals of Software Development 1 2
Class: Fields, Constructors, Methods public class Name. Dropper extends String. Transformer implements String. Transformable { private String name; // field: persistent storage, a permanent part // of each Name. Dropper public Name. Dropper(String what. My. Name. Is) { this. name = what. My. Name. Is; } // Constructor public String transform(String what. To. Say) { // Method return this. name + " says " + what. To. Say; } } Fundamentals of Software Development 1 Private means private to the class. The standard is that fields are generally private and all else is public (for now) – more on this later. Questions? 3
Summary • All Transformers obey the same general rules and interface – Each defines a transform method (rule) that takes a String and returns a String • This enables us to use the same Connection interaction for all of them – Differences among Transformer behaviors are hidden inside the transform method that each of them implements • Today we saw most of the basic pieces of Java – None was shown in sufficient detail to permit mastery – We’ll revisit all these pieces over the next few weeks!!! Fundamentals of Software Development 1 4
Integrated Development Environment (IDE) • A single, integrated tool that helps you: – Compile and run a program – Edit a program (Java. Eyes, Part 2) – Use JDK Help to learn what library tools to use • Compile: – Translate the source code into machine instructions • Run (execute) – Run the program, by executing the machine instructions • JDK Help – Documents a HUGE set of libraries – Those libraries are a large part of the power of Java Fundamentals of Software Development 1 5
Pair Programming • Two programmers working side-by-side, collaborating on the same design, algorithm, code or test – One programmer, the driver, has control of the keyboard/mouse and actively implements the program – The other programmer, the observer, continuously observes the work of the driver to identify tactical (syntactic, spelling, etc. ) defects and also thinks strategically about the direction of the work – On demand, the two programmers can brainstorm any challenging problem • You learn faster when a partner is helping double check – Two sets of eyes are more likely to notice errors than one set • You learn better when – a partner is helping you understand – you are challenging your partner to master the material Fundamentals of Software Development 1 6
Continuing work outside class • When you are in class: – Identify and schedule (exact) times to meet face to face – Identify ways to contact your partner (email, phone, etc) • Do not waste your partner's time – Show up on time and stay focused for scheduled meetings – Do not work on the project without your partner • Pair programming is not team programming You will do most of your projects using Pair Programming – we insist that you do it effectively! Fundamentals of Software Development 1 7
What’s Ahead? • Before the next session: Reminder: Find the homework assignment from the Schedule page of the CSSE 120 Angel site angel. rose-hulman. edu – Do Homework 3 (no late homework!) • Including the reading and the associated online quiz • Make arrangements NOW to meet with your partner for Java. Eyes, Part 3! Allocate about 45 minutes. • Next session: – Things, Types and Names – More Java. Eyes! • Documentation and Javadoc Suggestion: Routinely do your homework in F-217 (CSSE lab). A student assistant is there every Sunday through Thursday evening, 7 pm to 9 pm, so you can get immediate answers to any questions Fundamentals of Software you might have. Development 1 8
- Slides: 8