| Online Eiffel Documentation

EiffelStudio

# Code generation

All actions taken in the diagram tool that modify a part of the system are immediately reflected in the Eiffel system. Following is a summary of these actions.

- When you create a new class, this is the generated empty class:

      indexing
      	description: "Objects that ..."
      	author: ""
      	date: "$Date: 2006-10-04 15:00:39 -0700 (Wed, 04 Oct 2006) $"
      	revision: "$Revision: 64151 $"

      class
      	CLASS_NAME

      end -- class CLASS_NAME

- When you delete a class, the class file is removed from the disk.
- When you add a parent to a class, the parent is inserted in the existing inheritance clause, without any additional ( undefine / select /etc.) clauses to solve possible conflicts.

      indexing
      	description: "Objects that ..."
      	author: ""
      	date: "$Date: 2006-10-04 15:00:39 -0700 (Wed, 04 Oct 2006) $"
      	revision: "$Revision: 64151 $"

      class
      	CLASS_NAME

      inherit
      	NEW_PARENT

      end -- class CLASS_NAME

- When removing an inheritance link, the entire parent clause is removed, i.e. including any redefine / undefine /etc. until the matching end .
- When creating a client link, a function or attribute is generated by the feature wizard. When creating a function, this code is generated:

      indexing
      	description: "Objects that ..."
      	author: ""
      	date: "$Date: 2006-10-04 15:00:39 -0700 (Wed, 04 Oct 2006) $"
      	revision: "$Revision: 64151 $"

      class
      	CLASS_NAME

      feature -- Access

      	f: TYPE is
      				-- Client from CLASS_NAME to TYPE.
      		do
      		end

      end -- class CLASS_NAME

- If you choose to create an attribute for the client link, and optionally specify to generate a set-procedure and an invariant, the following code will be pasted into the class text:

      indexing
      	description: "Objects that ..."
      	author: ""
      	date: "$Date: 2006-10-04 15:00:39 -0700 (Wed, 04 Oct 2006) $"
      	revision: "$Revision: 64151 $"

      class
      	CLASS_NAME

      feature -- Access

      	f: TYPE is
      				-- Client from CLASS_NAME to TYPE.

      feature --  Element change

      	set_f (a_f: TYPE) is
      			 -- Client from CLASS_NAME to TYPE.
      		require
      			a_f_not_void: af /= Void
      		do
      			f := a_f
      		ensure
      			f_assigned: f = a_f
      		end

      invariant
      	f_not_void: f /= Void

      end -- class CLASS_NAME

- When removing a client link, only the matching function or attribute is removed. Any additionally generated set-feature or invariant is not removed.
- When removing a cluster, the associated directory is not erased, but the reference to the cluster is removed from the configuration file. At this time, it is not possible to create a cluster using the diagram tool, only to remove one.