Bleeding at the Keyboard: A Guide to Modern Programming with Java

Bleeding at the Keyboard

Bleeding at the Keyboard

Author Gregory J. E. Rawlins
Format online HTML
Price free

Creating a Java program is a bit like making a movie or putting on a play. Every theatrical production needs actors (in Java these are objects), roles the actors play (classes), and scenes the actors play out (methods). In a movie or play, actors step into one of their scenes when given a cue; in a Java program, objects enter one of their methods when cued to do so by another object. The Java interpreter, which runs each Java program, is like a combination stage manager and producer—it creates the set, casts the actors, and teaches them their roles. We, as Java programmers, are like playwrights (or screenwriters) and directors put together, we specify the roles the actors will play. Our program’s users are the audience.

Just as a stage manager and a producer read a play or movie script to find out what sets to create and what kinds of actors to audition, the Java interpreter reads each of the classes that we as programmers write to find out how objects of that class must behave (their role). Unlike temperamental actors, however, each Java object does exactly as its class tells it, so each object is the personification of a single role.

Real actors can play many roles; Java objects are all role. A play’s script usually specifies the actions of many characters in lots of different roles: butlers, tycoons, girl scouts, lone gunmen. A Java class, however, only specifies the actions of one quite specific type of character; that is, one role. So a simple Java program might be the equivalent of an extremely boring play about a butler forever polishing silverware, or a snoozer about a tennis pro playing exactly one round of a game of tennis. A complex program, however, might describe a universe of thousands of roles for its objects to play, all working together to run a sophisticated game, a nuclear power station, a national telephone service, or an orbital telescope.

Chapters include:

  • Setting the Stage
  • Introducing the Players
  • Behind the Scenes
  • Character Study
  • Stage Direction
  • All Together Now
  • It Takes All Types
  • What’s in a Name?
  • Think Like an Object
  • Let the Games Begin
  • The Play’s the Thing
  • Networking
  • Defensive Programming
  • Design Patterns
  • Navel Gazing
  • Satori
  • Avoiding Style Crime
  • Java’s Flaws
  • Book Recommendations
  • The Rest of Java

Read Mirror

Leave a Reply

Your email address will not be published. Required fields are marked *