|
|
|
Notes from 55th International STC Conference
Philadelphia, Pennsylvania, June 1-4, 2008
Introduction to Java™ Concepts for Non-Programmers
Elsie A. Sanders, Intervoice, Inc.
Sanders has made numerous trips to the winners’ circle in STC Online Help competitions, including a
Distinguished Award in a 2008 competition for her Intervoice Banking 4.0, Installation Guide. She used metaphor
very adroitly to explain a highly technical subject to a lay audience.
Session Description:
Increasingly, developers and programmers are using the Java language and object-oriented programming. This session
introduces non-programmers to basic concepts and provides strategies for further study and career marketability.
- Computers today
- 50M U.S. adults bank online
- 3,000 credit card transactions per minute
- Significant events
- Object-oriented programming
- Java language
- Object-oriented programming: what is it?
- And what is an Object?
- Example: automated flood warning system sends out telephone message en masse and redials numbers where it gets
an answer machine (or no answer)
- PersonalizeIt... caller repeatedly asking for checking account balance is given option to have it come up
automatically as soon as the caller’s number is recognized by the system
- Even non-experts need to know basic nomenclature such as Objects and Classes so they can use the system optimally
- What is an Object? Used elephant metaphor.
- Commands (e.g., traffic light)... must be precise
- Turn off all of the lights
- Turn on the red light
- Wait for 60 seconds
- Turn off the red light
- Turn on the green light... etc.
- Analogy for object-oriented programming: Moving kitchen from outside (open fireplace) to inside (enclosed,
vented coal stove)
- Procedural programming vs. object-oriented programming
- The Java language forced the programmer to take an object-oriented rather than a procedural approach
- Objects have characteristics (nouns) and behaviors (verbs)
- Scroll bar
- Menu bar
- Garbage can
- Many objects interacting
- Object-oriented programming (OOP), object-oriented design (OOD), and Java were ideal for the Internet, resulting
in explosive growth
- Single sourcing, content management, or DITA in essence reduce content to “objects” (chunks of data)
- Writing code in capsules (objects) allows reuse
- Shopping cart is an Object and more (the icon connotes the concept of buying multiple objects, paying before
leaving, etc.)
- Three elements of an Object
- Name: shoppingCart
- Characteristics: nouns: text, icon, color, shape
- Behaviors (methods): getOrderItem, AddToOrder, getQuantity, addToCart
- Object is a chunk of code that creates the characteristics and performs the behaviors
- Action plan for session (informational overview for general user to detailed study for practictioners)
- General framework/mental model of what Java and OOP/OOD are
- Classes and objects
- Single-sourcing, content modeling, DITA
- Application Programming Interface (API) documentation: toughest
- Resources on STC site:
- Handout
- OOP terminology
- OOP’s power
- JavaTM language
- Core concepts
- Objects and Classes
- Object-oriented programming
- Java language basics
- Packages: Java has 100s of packages with over 5,000 classes
- This led to an extension called Javax, JApplets, etc.
- Packages have language and utilities
- Class is a template
- Easier
- Faster
- Consistent
- Reusable
- A class is also a blueprint; from this, the objects (houses) are created. Variations like # of rooms, roof color,
etc., can be accomplished by mods to the class blueprint
- Programmer seeking a language goes to language “shelf” in Java and has 32 classes (blueprints) to choose from
(capsules of already written code: anywhere from a page to a hundred pages), lessening the amount of detailed new
code to be generated (much more cost effective)
- Objects: shirt analogy. Basic blueprint, colors and patterns change
- Objects: cookie cutter analogy (repetition of characteristics)
- Class is like a recipe: ingredients, procedures (can make many different foods)
- Package > class/recipe
- You cannot make an Object without creating a Class. Example: Auto dealer wants online shopping capability
where viewer can “build” a car
- Keywords – 50 in Java
- Object
- ClassBlueprint
- Constructor ( )
- Car myConvertible; myConvertible = new Car ( );
- Objects can be created from scratch (new code), but reuse of as many functions as possible speeds the process
and reduces cost
- CarClass: characteristics and behaviors (methods): specific objects are created by selecting characteristics
and behaviors
- Objects allow you to test it, debug it, reuse it, and modify it
- Classes: easier to use, faster, consistent, reuse, some code can be hidden to user, programmer can change
hidden code.
- Advanced OOP has 4 key aspects: Abstraction, encapsulation, inheritance, and polymorphism
- Abstraction: a little like abstract art; details are left out, artist drives for the “essence.”
Programmers group code in little “models” or templates, minimizing the impact of changes
- Control complexity of code
- Reduce amount of code
- Identify framework of code
- Determine relationships
- Encapsulation: hides some of the “engine code” from the user (analogy: visitor sees dining room, cook
goes into kitchen to get food): Java keywords are “private” and “public”
- Faster to develop
- Fewer bugs
- Allows programmer to change the code
- Others can’t change what’s inside
- Inheritance: 200 lines of code, hardware engineers, software engineers, test engineers. Each subset
inherits the characteristics of the class above it.
- Polymorphism: Animal speak () click on dog and it barks; click on cat and it meows.
- Java powers
- More than 4.5 devices
- Over 800M PCs
- Over 1.5B million mobile phones and other hand-held devices
- 2.2B smart cards
- Web cams, games, car navigation systems, medical devices, parking payment
- Java classes have grown from 250 classes in 1995 to 5,000 in 2004 – now leading to Javax
- Of the predefined 5,000 classes, 28 do 90% of the work: if you’re dabbling in it, learn those 28 first
- OOP and Java
- Object-oriented programming
- Classes and objects
- Basic Java code
|