mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:halw
Date:2010-03-03T21:09:17.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@500 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,3 @@
|
||||
title=es gt feature tool callers 01
|
||||
author=halw
|
||||
path=content/es-gt-feature-tool-callers-01
|
||||
@@ -1,53 +1,68 @@
|
||||
[[Property:title|Browsing Features]]
|
||||
[[Property:weight|-6]]
|
||||
[[Property:uuid|2c0b0a6c-08e8-fdbc-1eab-e2d87b01ce48]]
|
||||
Let us get back to EiffelStudio. We won't need a browser any more for this Tour, so you may close any browser window (other than the <span>current</span> window if you are reading this in HTML!) opened to look up the generated documentation in the previous section.
|
||||
Let us get back to EiffelStudio. Before studying the documentation generation we saw how to display properties of '''classes'''. It's also interesting to explore the properties of '''features'''.
|
||||
|
||||
Before studying the documentation generation we saw how to display properties of <span>classes</span>. It's also interesting to explore the properties of <span>features</span>. Let's look at this now, through the Feature View.
|
||||
There are two tools with similar sounding names that we will use to explore features:
|
||||
# The [[Features Tool|Features tool]] (plural) which provides a list of the immediate features of the class on which the development window is targeted. This tool is located by default in the vertical pane on the right hand side of the development window.
|
||||
# The Feature tool (singular) which allows you to explore the properties of some particular feature. By default, the Feature tool is available as a tab on the lower pane of the development window along with the Class tool, Outputs tool, and others.
|
||||
|
||||
Your Development Window should still be targeted to class <code>LIST</code>, from the last view, <code>Routines</code>, that you displayed on it. If you've lost it, just retarget a Development Window to this class.
|
||||
|
||||
If the Features Tool is not visible, bring it back by clicking the <code>Features</code> button on the top toolbar, used earlier to remove it.
|
||||
Let's start by making the [[Features Tool|Features tool]] visible. To see the Features tool click on the tab labeled [[Image:features-tab]] (note that this is the plural "Features" versus the singular "Feature").
|
||||
|
||||
(Another way is through the menu entry <code lang=text>View --> Tools --> Features</code> ).
|
||||
If the tab for the Features tool is not visible, bring it back by following the menu path:
|
||||
<code lang="text">
|
||||
View --> Tools --> Features
|
||||
</code>
|
||||
|
||||
While we are at it, let's get make the Feature tool visible as well. Click on the tab on the lower pane that's labeled [[Image:feature-tab]]. As with the Features tool, if the Feature tab is missing, you can use the menu path to restore it.
|
||||
|
||||
One more thing, and we'll look at some features. If you restarted EiffelStudio since you worked through the [[Viewing Classes]] section, you may have to select Link Context Tool again from the <code>View</code> menu.
|
||||
|
||||
==Targeting to a feature==
|
||||
|
||||
The list of features, organized by feature clauses, appears on the left:
|
||||
The list of features, organized by feature clauses, appears in the Features tool:
|
||||
|
||||
[[Image:index-51]]
|
||||
[[Image:es gt features tool 01]]
|
||||
|
||||
The class only has a few immediate features because most of its interesting features are inherited. Make sure the Editing Tool is tall enough (as on the above figure) and click the feature <code>forth</code>, the last one, in the Feature Tree on the left. This makes the feature the Editing Tool's current target, and scrolls the text to its declaration:
|
||||
The class only has a few immediate features because most of its interesting features are inherited. Make sure the Editor tool is tall enough (as on the above figure) and click the feature <code>forth</code>, the last one, in the Feature Tree on the left. This makes the feature the Editor tool's current target, and scrolls the text to its declaration:
|
||||
|
||||
[[Image:index-52]]
|
||||
[[Image:es gt features tool 02]]
|
||||
|
||||
Note how both of the top target fields are now filled: the first one shows the target class, <code>LIST</code>, and the second one shows the target feature, <code>forth</code>.
|
||||
|
||||
==Basic feature information==
|
||||
|
||||
Now let's look at the feature views. Click the Feature Tab at the bottom of the Context Tool.
|
||||
Now let's look at the views of the feature <code>forth</code> provided in the Feature tool.
|
||||
|
||||
This brings up basic information on the selected feature in the Context Tool.
|
||||
A view of <code>forth</code> is already visible in the Feature tool. By default, it is the <code>Flat</code> view.
|
||||
|
||||
The bottom Context Tool shows one of the Feature views, by default <code>Flat</code>. The flat view of a feature, similar in concept to the flat view of a class, gives the full text of a feature, taking into account any inherited precondition or postcondition clauses. Here the feature as declared in the class appears in the top Editing Tool, with no precondition and an <code>ensure then</code> postcondition clause. But it's a redefinition of an inherited feature; the flat view in the bottom Context Tool shows the full precondition, inherited from the ancestor <code>LINEAR</code>, as well as the postcondition from <code>LIST</code>.
|
||||
[[Image:es gt feature tool 01]]
|
||||
|
||||
<code>Flat</code> is just one of the available Feature Views, shown by the buttons on the Feature View toolbar
|
||||
The flat view of a feature, similar in concept to the flat view of a class, gives the full text of a feature, taking into account any inherited precondition or postcondition clauses. Here the feature as declared in the class appears in the top Editing Tool, with no precondition and an <code>ensure then</code> postcondition clause. But it's a redefinition of an inherited feature; the flat view in the bottom Context Tool shows the full precondition, inherited from the ancestor <code>LINEAR</code>, as well as the postcondition from <code>LIST</code>.
|
||||
|
||||
<code>Text</code> gives the feature text, fully clickable.
|
||||
<code>Flat</code> is just one of the available Feature Views, shown by the buttons on the toolbar of the Feature tool.
|
||||
|
||||
[[Image:es gt feature tool toolbar buttons 01]]
|
||||
|
||||
You can mouse-over the different buttons to see the views they represent.
|
||||
|
||||
Just to the left of <code>Flat</code>, <code>Basic Text</code> gives the feature text, fully clickable.
|
||||
<div>
|
||||
==Who calls this feature?==
|
||||
|
||||
Next to <code>Flat</code> is <code>Callers</code>. Try it now by clicking the corresponding button (the following figure and the next only show the Context Tool, where the views appear):
|
||||
To the right of <code>Flat</code> is <code>Callers</code>. Try it now by clicking the corresponding button. You may have to scroll down some in the display to see the series of entries show in the image below;
|
||||
|
||||
[[Image:index-55]]
|
||||
[[Image:es gt feature tool callers 01]]
|
||||
|
||||
This view shows all the places in the system that call the routine, or one of its redefinitions. Such information can be invaluable for debugging in particular. The successive paragraphs correspond to the various versions of <code>forth</code> in class <code>LIST</code>, its ancestors and its descendants. Reading from the top we see that:
|
||||
This view shows all the places in the system that call the routine, or one of its redefinitions. Such information can be invaluable for debugging in particular. The successive paragraphs correspond to the various versions of <code>forth</code> in class <code>LIST</code>, its ancestors and its descendants. Reading from the top we'll examine a few entries:
|
||||
* The version from <code>LIST</code> is called in <code>LIST</code> itself by the function <code>is_equal</code>.
|
||||
* The version from <code>LIST's</code> descendant <code>ARRAYED_CIRCULAR</code> is not called directly in this system, although it '''could''' be called through dynamic binding (on an entity declared of type <code>LIST</code> but dynamically attached to an instance of <code>ARRAYED_CIRCULAR</code>).
|
||||
* About 60% down, <code>forth</code> from <code>ARRAYED_LIST</code>, a version in another descendant of <code>LIST</code>, is called by two routines of <code>ARRAYED_CIRCULAR</code>, one routine of <code>ARRAYED_LIST</code>, and two routines of <code>MULTI_ARRAY_LIST</code>.
|
||||
* Also note, in the following entry, that after renaming <code>forth</code> is called <code>back</code> in the descendant <code>ARRAYED_STACK</code>.
|
||||
|
||||
The following five view buttons are similar except that they let you precise what kind of callers you are looking for, or what is being called by the currently selected feature.
|
||||
* The version from <code>LIST</code> is called in routines in two debugger classes <code>RT_DBG_CALL_RECORD</code> and <code>RT_DBG_COMMON</code>
|
||||
* The version <code>forth</code> from <code>MULTI_ARRAY_LIST</code> is a version in a descendant of <code>LIST</code>, and is called by three routines of <code>MULTI_ARRAY_LIST</code> itself: <code>duplicate</code>, <code>put_right</code>, and <code>remove_right</code>.
|
||||
* Although it is not shown in the figure, if you scroll around some, you will find cases in which a descendant of <code>forth</code> has been renamed and that renamed version is called. For example <code>child_forth</code> from <code>LINKED_TREE</code> is descendant version of <code>forth</code> and is called by routines in <code>LINKED_CURSOR_TREE</code> and <code>LINKED_TREE</code>.
|
||||
|
||||
The following five view buttons are similar except that they let you specify what kind of callers you are looking for, or what is being called by the currently selected feature. Feel free to explore these views.
|
||||
|
||||
==What happens to my feature through the inheritance hierarchy?==
|
||||
|
||||
@@ -55,7 +70,7 @@ After the caller/callee views, the next view button is <code>Implementers</code>
|
||||
|
||||
This is a very useful view, showing all the ancestors and descendants of <code>LIST</code> that provide a separate version of <code>forth</code>, including the original introduction of this feature in <code>LINEAR</code> and subsequent redeclarations (redefinitions or effectings). The mention <code lang=text>(version from)</code> signals the version applicable to the current class, here <code>LIST</code>.
|
||||
|
||||
Since all class and feature names on these views are hyperlinks, you can display any of the listed versions in a new Development Window by control-right-clicking it (we will see shortly how to display it in the <span>same</span> tool). Right-click on the feature name <code>forth</code> on the line that reads <code>MULTI_ARRAY_LIST forth</code>. This brings up a context menu and chose <code lang=text>Show --> Text</code>. The tool is now targeted to the routine <code>forth</code> from <code>MULTI_ARRAY_LIST</code>, so that you can see the implementation of the routine in that class.
|
||||
Since all class and feature names on these views are hyperlinks, you can display any of the listed versions in a new Development Window by control-right-clicking it (we will see shortly how to display it in the ''same'' tool). Right-click on the feature name <code>forth</code> on the line that reads <code>MULTI_ARRAY_LIST forth</code>. This brings up a context menu and chose <code lang=text>Show --> Text</code>. The tool is now targeted to the routine <code>forth</code> from <code>MULTI_ARRAY_LIST</code>, so that you can see the implementation of the routine in that class.
|
||||
|
||||
We still have two unexplored views, <code>Ancestor versions</code> and <code>Descendant versions</code>. Click the first of these to obtain the ancestor versions of <code>forth</code> from <code>MULTI_ARRAY_LIST</code>.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user