Software Engineering Project Lecture: OOP and  GUI Design

Object Orientated Design:
I have found object orientated programming a very enjoyable programing paradigm.  The program is easily maintained and extendable.  The programming language helps to structure the program.  Also the programming language is very flexible.

Aspects of OOP that are particularly useful are:

A typical OO design process for teams is the CRC card technique.  A similar procedure that can be used by an individual is:
  1. Restate project specification:
    1. Make sure you are clear on the problem you are solving.
  2. List candidate classes:
    1. Brian storm a list of candidate classes.  While brian storming remember all ideas are potential good ideas.  Think fast and furiously first, ponder latter.

      A good source of classes are the nouns in the project statement.  Be careful and stay on track.  Solve the current problem with an eye to what is to come.  Recall java classes represent real life objects.
       

  3. Identify key classes:
  4. Specify classes:
    1. Class can be specified by a diagram.  The diagram is a box with the name of the class high in the box below the name is  a horizontal line followed by a list of  method names.

      This is very similar to an java interface.  I frequently use interfaces to implement this part of the design.  Also interfaces allowing me to continue programming without worrying about how I will implement a class.
       

  5. Diagram class hierarchy
  6. Evaluate classes and  hierarchy
    1. The characteristics of a good class are:


      The class hierarchy and structure should be simple and not tightly coupled.

      Use a classes with your use-cases.

Graphical User Interface Design:
In many aspects the gui is the most important part of the program.  The gui can determine if the user enjoys or hates using the program.  If the user hates using the program he will stop using it.  Interesting that in industry there are generally no gui expert; all programmers are expected to be able to write good and effective gui.

Typical user interactions with the computer are:

Besides input to the program, the program also need to provide output.  Presentation of the data can be graphs, text or sound.  It is generally a good idea to keep the presentation of data separate from the data.  In other words the same object that keeps and creates the data should not present it.  Keeping the presentation separate allows maximum flexibility of the presentation.  The user can request different ways to present the data.  Generally information should be presented in text only when precise values are required by the users otherwise graphical presentation of the data is preferred.

The gui programers should always consider the user, his expertise and experience using computers.  The principles of designing a gui are:

From my personal experience, the best tools for gui design are drawings of the windows and use-cases.  Use-cases are good for checking that gui performs the use tasks efficiently.

Because the gui presentation is so important to the program's success, it is important to get a mock-up gui to the client has soon as possible.  A mock-up gui is a program that opens up the window with the menus, text fields etc. but when the user makes a selection the program only output a text message to standard out.

If you are not familiar with the gui programming  refer to Objects have Class, chapter 14, Graphical User Interfaces.  Also study the java api at http://java.sun.com/j2se/1.4/docs/api/ in particular study the java.AWT and javax.swing packages.  Sun web sites have excellent tutorial at http://java.sun.com/docs/books/tutorial/ in particular the swing tutorial at http://java.sun.com/docs/books/tutorial/uiswing/index.html.

Now is the time to read the second project assignment.