Example Project: Families
Appendix 
B

CONTENTS

About the Project

The Family Tree project is a visual example of what you can achieve using Together/J.  It provides a ready made project that includes several of the most common UML diagrams that would typically be created in modeling a project. All the diagram images presented here have been produced using Together/J's Print Specifications feature.

This Family Tree application creates and stores Individuals in a Family structure, which then make up a Family tree through links to other families.  These links can be traversed to create lists of Individuals and Families, and more importantly, the tree can be used to create a list of Ancestors or Descendants of specific Individuals.
 

Opening the project

 

The Class Diagram

The first diagram to appear after opening the Families project is the top level class diagram.  This view is primarily made up of the main packages  - Human Interface, Problem Domain and Data Management, and Application. The latter caontains only the main Java class that runs the whole application.

Using this diagram you can navigate down and browse the other packages shown:

The other package that appears at this level is called 'View'.  This is a logical view and shows all the essential classes in the application on one diagram - having 'imported' them from the other packages to produce one diagram.  You can browse this view by: This creates a new browser window and displays the diagram in the Diagram pane.
 

Hyperlinks

On the top level diagram, several of the diagram elements have been linked to other types of documents/diagrams: You can link your own diagrams, files, URL's to any diagram and/or element by:  

Problem Domain

Problem Domain diagram - produced within Together/J with Generate Documentation...

This package contains the actual classes from the analysis and design stage of development, and models the real world problem.  This diagram shows the navigation on the links because it makes it more easier to visually see the relationship flow.
 
A description of the classes found in the Problem Domain

Also on this diagram there is the imported class 'FamilyFrame', shown with a cut top right hand corner to depict that it is imported.  This allows the diagram to show the relationships between the Problem Domain and the main class in the Human Interface. Any changes to this class will change the class in the actual package. Because packages can display their classes, the top level diagram shows the Problem Domain package with the imported class in italics.
 

Human Interface

Human Interface diagram - produced within Together/J with Generate Documentation...

This package contains implementation classes.  These classes are the user level of the application.  It is through this level that the user can call and view the various lists.  It is the Human Interface - FamilyFrame class that controls the application and handles all events and messages.

A description of the classes found in Human Interface

Because the FamilyApplication class on the top level diagram has a dependency link to the Human Interface package, Together/J automatically shows this class on this diagram.

Hyperlinks

The FamilyFrame class has several hyperlinks - the class name appears in blue and bold to indicate links for classes.  The class itself is linked to the state diagram, while two of its operations, getAncestors and newIndividual are also hi-lighted in blue to show they too have links:

Data Management

Data Management diagram - produced within Together/J with Generate Documentation...

This package holds a simple model for the control of the data, i.e. the opening and saving of the data:

DMControl - the main data control class that knows what type of data it will read in, flat file (as in this example), database etc...

FamilyDM - knows how to set and store the family records that a read in from the data storage.

IndividualDM - knows how to set and store the family records that a read in from the data storage.

IFamiliesDM & IIndividualsDM are the interfaces that the DMControl class must implement in order to read in the data records.

FlatFile

Flat File diagram

The FlatFile package contains the FlatFile class that has the behaviour to store the Family Tree details out to a text file on the local system.  Other packages at a later date could be added to allow classes to be stored by other means i.e  RTF, Database etc...
 

View

View diagram

This diagram is made up of all of the main classes that make up this application, in fact you can also import classes from different packages located on the class or source path of the project - File | Project Properties.  Changes can be made directly to these classes unless you have imported compiled or read-only classes.
 

Documentation

Using Print Specifications... the whole project has been documented in HTML and can be found in the Documentation subdirectory of the ./samples/Families directory.

 

The Use Case Diagram

UML Model: Use Case Diagram

The Use Case diagram shows the use cases for:

 

The State Diagram

UML Model: State Diagram

The State diagram in the Family project models the interactive GUI component class FamilyFrame.  It shows the various states of the class as various events are triggered.
 

Sequence Diagrams

UML Model:  getAncestors Sequence Diagram

The getAncestors Sequence diagram shows the sequence of events that leads to the creation of the Ancestors list for an Individual.  The recursive loops on the sequence diagram take the form of moving up each family branch above the Individual.  The first branch it takes is the Father's branch of the family, and then the Mother's branch of the tree.  Whenever it finds a Husband or Wife that have no Families above them, the recursion unwinds, taking other routes, until all the various branches above the Individual have been taken.

addIndividiual Sequence Diagram

The addIndividual Sequence diagram shows the sequence of events that leads to the creation of an Individual.  There are some data checks in the entryDlg object to make sure that all the required data has been entered before proceeding with the creation of the new record.  These missing fields or errors are reported back to the user via the ErrorDialog class.
 

Collaboration Diagrams

The Sequence diagrams above can be turned into Collaboration diagrams easily via the background context menu 'Show as.....' command.  Within this project there is already a Collaboration diagram called:

Collaboration

This shows the getAncestors collaboration.
 

Running the Application

The Family Tree project is a fully working application which can be compiled by a Java compiler and run.  The application sets up a default Family tree for you.  You can then use the application to manage these Individuals.

By default the application creates a small example Family Tree ready for you to use.  With the use of the File | Save as and File | Open menu you can create and store you own Family Trees.  This simple version has no implementation for entry of Marriage, Birth, Death or Divorce details.  If you want to start from scratch, then select File | Close to close the auto-generated Family Tree.
 

NB: Families must be created with the Husband first.  The application will warn you if you try to create a new family with the Wife as the starting member.
 

To Start the Application:

  1. Run command line or console
  2. Change directory to ./samples/Families
  3. Note that compiled classes are already available after installation in the ./samples/Families/classes subdirectory
  4. Invoke your Java VM for the main class of the application FamiliesApplication located in the Application package. Below is the sample code assuming you are using Sun JRE for Windows:

  5. jre -cp classes Application.FamiliesApplication
    The concrete command you should invoke may very depending on your OS, JVM and environment.

Creating Families from Existing Children in the Tree

Creating a new Family with a New Individual

Follow exactly the same process as above except for the husband, do not use the 'Individual' button. Rather, enter all details including Parent Of (because this is the husband of the family, this field should be his surname) then click on OK.
When adding a Wife,  you can either add an existing Individual to the Family using the 'Individual' button, or enter a new one, remembering to use the 'Married To' button to link to the Family.

Creating Children for Families

Updating/Amending an Individuals Details

Errors in the entry dialog will be reported back in the error message explaining exactly what the problems are.

NB: While creating Families you can at the same time add a new Individual to an existing Family by using the 'Child Of' button when entering the details.

Viewing the Ancestor or Descendent list

To view Ancestors or Descendants of Individuals within the Family Tree use View | Ancestors or View | Descendants.  This displays a list of all the Individuals.  Double clicking on an Individual will give you the Ancestor or Descendent list.

View | Show Spouse (this is a checkable menu option, by default it is off) works only with the View | Descendants. It adds the father's name to each Individual displayed on the Descendants list to make a large list more readable.


 Topic links for this chapter

 
GO TO TOP CONTENTS GETTING STARTED HELP CONTENTS
 
© 1997-98

This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)