The Art of Programming


Project Management

Three Software Development Roles

You will find yourself assuming the duties and responsibilities of three software development roles: analyst, architect, and programmer.

Analyst

The first software development role you will play as a student is that of analyst. When you are first handed a class programming project you may not understand what, exactly, the instructor is asking you to do. Hey, it happens! Regardless, you, as the student, must read the assignment and design and implement a solution.

Programming project assignments come in several flavors. Some instructors go into painful detail about how they want the student to execute the project. Others prefer to generally describe the type of program they want, thus leaving the details, and the creativity, up to you. There is no one correct method of writing a project assignment; each has its benefits and limitations.

A detailed assignment takes a lot of the guesswork out of what outcome the instructor expects. On the other hand, having every design decision made for you may prevent you from solving the problem in a unique, creative way.

A general project assignment delegates a lot of decision making to the student while also adding the responsibility of determining what project features will satisfy the assignment.

Both types of assignments model the real world to some extent. Sometimes software requirements are well defined and there is little doubt what shape the final product will take and how it must perform. More often than not, however, requirements are ill-defined and vaguely worded. As an analyst you must clarify what is being asked of you. In an academic setting, do this by talking to the instructor and ask him to clarify the assignment. A clear understanding of the assignment will yield valuable insight into possible approaches to a solution.

Architect

The second software development role you will play is that of architect. Once you understand the assignment you must design a solution. If your project is extremely small you could perhaps skip this step with no problem. However, if your project contains several objects that interact with each other, then your design, and the foundation it lays, could make the difference between success and failure. A well-designed project reflects a sublime quality that poorly designed projects do not.

Two objectives of good design are the abilities to accommodate change and tame complexity. Change, in this context, means the ability to incrementally add features to your project as it grows without breaking the code you have already written. Several important object-oriented principles have been formulated to help tame complexity and will be discussed later in the book. For starters though, begin by imposing a good organization upon your source-code files. For simple projects you can group related project source-code files together in one directory. For more complex projects you will want to organize your source-code files into packages. I will discuss packages later in the chapter.

Programmer

The third software development role you will play is that of programmer. As the programmer you will execute your design. The important thing to note here is that if you do a poor job in the roles of analyst and architect, your life as a programmer will be miserable. That doesn t mean the design has to be perfect. I will show you how to incrementally develop and make improvements to your design as you code.

Now that you know what roles you will play as a student, let s discuss how you might approach a project.

A Project-Approach Strategy

Most students have difficulty implementing their first significant programming assignment, not because they lack brains or talent, but because they lack experience. If you are a novice and feel overwhelmed by your first programming project, rest assured you are not alone. The good news is that with practice, and some small victories, you will quickly gain proficiency at formulating approach strategies to your programming projects.

Even experienced programmers may not immediately know how to solve a problem or write a particular piece of code when tasked to do so. What they do know, however, is how to formulate a strategy to solve the problem.

You Have Been Handed A Project—Now What?

Until you gain experience and confidence in your programming abilities, the biggest problem you will face when given a large programming assignment is where to begin. What you need to help you in this situation is a project-approach strategy. The strategy is presented below and discussed in detail. I have also summarized the strategy in a checklist located in appendix A. Feel free to reproduce the checklist to use as required.

The project-approach strategy is a collection of areas of concern to take into consideration when you begin a programming project. It s not a hard, fast list of steps you must take. It s intended to put you in control, to point you in the right direction, and give you food for thought. It is flexible. You will not have to consider every area of concern for every project. After you have used it a few times to get you started you may never use it explicitly again. As your programming experience grows, feel free to tailor the project-approach strategy to suit your needs.

Strategy Areas of Concern

The project-approach strategy consists of several programming project areas of concern. These areas of concern include application requirements, problem domain, language features, and application design. When you use the strategy to help you solve a programming problem your efforts become focused and organized rather than ad hoc and confused. You will feel like you are making real progress rather than drowning in a sea of confusion.

Application Requirements

An application requirement is an assertion about a particular aspect of expected application behavior. A project s application requirements are contained in a project specification or programming assignment. Before you proceed with the project you must ensure that you completely understand the project specification. Seek clarification if you do not know, or if you are not sure, what problem the project specification is asking you to solve. In my academic career I have seen projects so badly written that I thought I had a comprehension problem. I d read the thing over and over again until struck by a sudden flash of inspiration. But more often than not, I would reinforce what I believed an instructor required by asking them to clarify any points I did not understand.

Problem Domain

The problem domain is the specific problem you are tasked to solve. I would say that it is that body of knowledge necessary to implement a software solution apart and distinct from the knowledge of programming itself. For instance, Write a program to simulate elevator usage in a skyscraper. You may understand what is being asked of you (requirements understanding) but not know anything about elevators, skyscrapers, or simulations (problem domain). You need to become enough of an expert in the problem domain you are solving so that you understand the issues involved. In the real world, subject matter experts (SMEs) augment development teams, when necessary, to help developers understand complex problem domains.

Programming Language Features

One source of great frustration to novice students at this stage of the project is knowing what to design but not knowing enough of the language features to start the design process. This is when panic sets in and students begin to buy extra books in hopes of discovering the Holy Grail of project wisdom.

To save yourself from panic, make a list of the language features you need to understand and study each one, marking it off your list as you go. This provides focus and a sense of progress. As you read about each feature take notes on its usage and refer to your notes when you sit down to formulate your program s design.

High-Level Design & Implementation Strategy

When you are ready to design a solution you will usually be forced to think along two completely different lines of thought: procedural vs. object-oriented.

Procedural-based Design Approach

A procedural-based design approach is one in which you identify and implement program data structures separately from the program code that manipulates those data structures. When taking a procedural approach to a solution you generally break the problem into small, easily solvable pieces, implement the solution to each of the pieces separately, and then combine the solved pieces into a complete solution. The solvable pieces I refer to here are called functions. This methodology is also known as functional decomposition.

Although Java does not support stand-alone functions (Java has methods and a method must belong to a class), a procedural-based design approach can be used to create a working Java program, although taking such an approach usually results in a sub-optimal design.

Object-Oriented Design Approach

Object-oriented design entails thinking of an application in terms of objects and the interactions between these objects. No longer are data structures and the methods that manipulate those data structures considered to be separate. The data an object needs to do its work is contained within the object itself and resides behind a set of public interface methods. Data structures and the methods that manipulate them combine to form classes from which objects can then be created.

A problem solved with an object-oriented approach is decomposed into a set of objects and their associated behavior. Design tools such as the Unified Modeling Language (UML) can be used to help with this task. Following the identification of system objects, object interface methods must then be defined. Classes must then be declared and defined to implement the interface methods. Following the implementation of all application classes, they are combined and used together to form the final program. (This usually takes place in an iterative fashion over a period of time according to a well-defined development process.) Note that when using the object-oriented approach you are still breaking a problem into solvable pieces, only now the solvable pieces are objects that represent the interrelated parts of a system.

The primary reason the object-oriented approach is superior to functional decomposition is due to the isomorphic mapping between the problem domain and the design domain as figure 1-1 illustrates. Referring to figure 1-1, real-world objects such as weapon systems, radars, propulsion systems, and vessels have a corresponding representation in the software system design. The correlation between real-world objects and software design components, and ultimately to the actual code modules, fuels the power of the object-oriented approach.

image from book
Figure 1-1: Isomorphic Mapping Between Problem Domain and Design Domain

Once you get the hang of object-oriented design you will never return to functional decomposition again. However, after having identified the objects in your program and the interfaces they should have, you must implement your design. This means writing class member methods one line of code at a time.

Think Abstractly

One mistake students often make is to think too literally. It is very important to remember that the act of solving a real-world problem with a computer requires abstraction. The real world is too complex to model sufficiently with a computer program. One day, perhaps, the human race will produce a genius who will show us how it s done. Until then, analysts must focus on the essence of a problem and distill unnecessary details into a tractable solution that can then be modeled effectively in software.

The Strategy In A Nutshell

Identify the problem, understand the problem, make a list of language features you need to study and check them off as you go. Once you formulate a solution to the problem, break the problem into manageable pieces, solve each piece of the problem, and then combine the solved pieces to form a total solution.

Applicability To The Real World

The problem-approach strategy presented above is not intended to replace a formal course on software engineering, but it will help you when you enter the real world as a commercial programmer. In that world, you will soon discover that all companies and projects are not created equal. Different companies have different software development methodologies. Some companies have no software development methodology. If you find yourself working for such a company you will probably be the software engineering expert. Good luck!




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net