org.argouml.cognitive.critics
Class Critic

java.lang.Object
  extended byorg.argouml.cognitive.critics.Critic
All Implemented Interfaces:
Poster, Serializable
Direct Known Subclasses:
CompoundCritic, CrUML

public class Critic
extends Object
implements Poster, Serializable

"Abstract" base class for design critics. Each subclass should define its own predicate method and define its own relevance tags.

A critic supports design goals and decisions, which can be adjusted accordingly. It will post todo items which may or may not be relevant to the particular designer.

Steps to follow when adding a critic are listed in the Argo cookbook under define_critic.

See Also:
Serialized Form

Field Summary
private  Hashtable args
          Arguments used to configure the critic.
private  Icon clarifier
           
private  Hashtable controlRecs
          Control records used in determining if this Critic should be active.
private  String criticType
          The decision type of this critic.
private  String decisionCategory
          The decision category that this critic is relevant to.
static Icon DEFAULT_CLARIFIER
          The icon representing the resource.
private  String description
          The description of the ToDoItem produced.
private  String emailAddr
          The email address of the author/maintainer of this critic.
private static String ENABLED
          The keys of some predefined control records.
private  String headline
          The headline of the ToDoItem produced.
private  boolean isActive
          Internal flag that stores the end result of all ControlMech evaluations of this critic.
private  org.tigris.gef.util.VectorSet knowledgeTypes
           
static String KT_COMPLETENESS
          Type of knowledge that critics can deliver
static String KT_CONSISTENCY
          Type of knowledge that critics can deliver
static String KT_CORRECTNESS
          Type of knowledge that critics can deliver
static String KT_DESIGNERS
          Type of knowledge that critics can deliver
static String KT_EXPERIENCIAL
          Type of knowledge that critics can deliver
static String KT_OPTIMIZATION
          Type of knowledge that critics can deliver
static String KT_ORGANIZATIONAL
          Type of knowledge that critics can deliver
static String KT_PRESENTATION
          Type of knowledge that critics can deliver
static String KT_SEMANTICS
          Type of knowledge that critics can deliver
static String KT_SYNTAX
          Type of knowledge that critics can deliver
static String KT_TOOL
          Type of knowledge that critics can deliver
private static Logger LOG
          Logger.
private  String moreInfoURL
          The moreInfoURL of the ToDoItem produced.
static boolean NO_PROBLEM
          NO_PROBLEM is used for the result of the check of a critic.
private static int numCriticsFired
           
private  int priority
          The priority of the ToDoItem produced.
static boolean PROBLEM_FOUND
          PROBLEM_FOUND is used for the result of the check of a critic.
private static String SNOOZE_ORDER
           
private  Vector supportedDecisions
           
private  Vector supportedGoals
           
private  long triggerMask
           
 
Constructor Summary
Critic()
          Construct a new critic instance.
 
Method Summary
 Object addControlRec(String name, Object controlData)
          Add some attribute used by ControlMech to determine if this Critic should be active.
 void addKnowledgeType(String type)
           
 void addSupportedDecision(Decision d)
           
 void addSupportedGoal(Goal g)
           
 void addTrigger(String s)
           
 void beActive()
          Make this critic active.
 void beInactive()
          Make this critic inactive.
 boolean canFixIt(ToDoItem item)
          TODO: Not implemented yet.
 boolean containsKnowledgeType(String type)
           
 void critique(Object dm, Designer dsgr)
          Examine the given Object and Designer and, if appropriate, produce one or more ToDoItem's and add them to the offending design material's and the Designer's ToDoList.
 String defaultMoreInfoURL()
          This function calculates the default url to describe this critic.
 String expand(String desc, org.tigris.gef.util.VectorSet offs)
          Customize the description string just before it is displayed.
 void fixIt(ToDoItem item, Object arg)
          TODO: Not implemented yet.
protected  Object getArg(String name)
           
 Hashtable getArgs()
           
 Icon getClarifier()
           
 Object getControlRec(String name)
          Reply the named control record, or null if not defined.
 String getCriticCategory()
          Returns a default critic category.
 ConfigurationKey getCriticKey()
          Returns the ConfigurationKey that the critic uses to determine if it is enabled or disabled.
 String getCriticName()
          Returns a default critic name.
 String getCriticType()
          Reply a string used to contol critics according to type.
 String getDecisionCategory()
          Reply a string used to determine if this critic would be relevant to current design decisions.
 String getDescription(org.tigris.gef.util.VectorSet offenders, Designer dsgr)
          Reply the description used in feedback produced by this Critic.
 String getDescriptionTemplate()
           
 String getExpertEmail()
          Reply the email address of the person who is the author or maintainer of this critic.
 String getHeadline()
          Reply the headline used in feedback produced by this Critic.
 String getHeadline(Object dm, Designer dsgr)
          Reply the headline used in feedback produced by this Critic.
 String getHeadline(org.tigris.gef.util.VectorSet offenders, Designer dsgr)
          Reply the headline used in feedback produced by this Critic.
 org.tigris.gef.util.VectorSet getKnowledgeTypes()
           
 String getMoreInfoURL()
           
 String getMoreInfoURL(org.tigris.gef.util.VectorSet offenders, Designer dsgr)
          Reply the moreInfoURL used in feedback produced by this Critic.
 int getPriority()
           
 int getPriority(org.tigris.gef.util.VectorSet offenders, Designer dsgr)
          Reply the priority used in feedback produced by this Critic.
 Vector getSupportedDecisions()
           
 Vector getSupportedGoals()
           
 long getTriggerMask()
           
 Class getWizardClass(ToDoItem item)
          Return the Class of wizard that can fix the problem identifed by this critic.
 void initWizard(Wizard w)
          Initialize a newly created wizard with information found by the critic.
 boolean isActive()
          Reply true iff this Critic can execute.
 boolean isEnabled()
          This is a convient method for accessing one well-known control record.
 boolean isRelevantToDecisions(Designer dsgr)
          Reply true if this Critic is relevant to the decisions that the Designer is considering.
 boolean isRelevantToGoals(Designer dsgr)
          Reply true iff this Critic is relevant to the goals that the Designer is trying to achieve.
 Wizard makeWizard(ToDoItem item)
          Create a new Wizard to help the user fix the identified problem.
 boolean matchReason(long patternCode)
           
 void postItem(ToDoItem item, Object dm, Designer dsgr)
           
 boolean predicate(Object dm, Designer dsgr)
          Perform the Critic's analysis of the design.
static int reasonCodeFor(String s)
           
protected  void setArg(String name, Object value)
           
 void setArgs(Hashtable h)
           
protected  void setDecisionCategory(String c)
          Set the decisionCategory, usually done in the constructor.
 void setDescription(String d)
           
 void setEnabled(boolean e)
           
 void setExpertEmail(String addr)
          Set the email address of the person who is the author or maintainer of this critic.
 void setHeadline(String h)
          Set the headline used in feedback produced by this Critic.
 void setKnowledgeTypes(String t1)
          Reset all knowledgetypes, and add the given one.
 void setKnowledgeTypes(String t1, String t2)
          Reset all knowledgetypes, and add the given ones.
 void setKnowledgeTypes(String t1, String t2, String t3)
          Reset all knowledgetypes, and add the given ones.
 void setKnowledgeTypes(org.tigris.gef.util.VectorSet kt)
           
 void setMoreInfoURL(String m)
           
 void setPriority(int p)
           
 void snooze()
          Disable this Critic for the next few minutes.
 SnoozeOrder snoozeOrder()
          Reply the SnoozeOrder that is defined for this critic.
 boolean stillValid(ToDoItem i, Designer dsgr)
          Return true iff the given ToDoItem is still valid and should be kept in the given designers ToDoList.
 boolean supports(Decision d)
           
 boolean supports(Goal g)
           
 ToDoItem toDoItem(Object dm, Designer dsgr)
          Reply the ToDoItem that the designer should see iff predicate() returns true.
 String toString()
          Reply a string that describes this Critic.
 void unsnooze()
          Lift any previous SnoozeOrder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Logger.


PROBLEM_FOUND

public static final boolean PROBLEM_FOUND
PROBLEM_FOUND is used for the result of the check of a critic.

See Also:
Constant Field Values

NO_PROBLEM

public static final boolean NO_PROBLEM
NO_PROBLEM is used for the result of the check of a critic.

See Also:
Constant Field Values

ENABLED

private static final String ENABLED
The keys of some predefined control records.

See Also:
Constant Field Values

SNOOZE_ORDER

private static final String SNOOZE_ORDER
See Also:
Constant Field Values

KT_DESIGNERS

public static final String KT_DESIGNERS
Type of knowledge that critics can deliver


KT_CORRECTNESS

public static final String KT_CORRECTNESS
Type of knowledge that critics can deliver


KT_COMPLETENESS

public static final String KT_COMPLETENESS
Type of knowledge that critics can deliver


KT_CONSISTENCY

public static final String KT_CONSISTENCY
Type of knowledge that critics can deliver


KT_SYNTAX

public static final String KT_SYNTAX
Type of knowledge that critics can deliver


KT_SEMANTICS

public static final String KT_SEMANTICS
Type of knowledge that critics can deliver


KT_OPTIMIZATION

public static final String KT_OPTIMIZATION
Type of knowledge that critics can deliver


KT_PRESENTATION

public static final String KT_PRESENTATION
Type of knowledge that critics can deliver


KT_ORGANIZATIONAL

public static final String KT_ORGANIZATIONAL
Type of knowledge that critics can deliver


KT_EXPERIENCIAL

public static final String KT_EXPERIENCIAL
Type of knowledge that critics can deliver


KT_TOOL

public static final String KT_TOOL
Type of knowledge that critics can deliver


emailAddr

private String emailAddr
The email address of the author/maintainer of this critic.


priority

private int priority
The priority of the ToDoItem produced.


headline

private String headline
The headline of the ToDoItem produced.


description

private String description
The description of the ToDoItem produced.


moreInfoURL

private String moreInfoURL
The moreInfoURL of the ToDoItem produced.


args

private Hashtable args
Arguments used to configure the critic. TODO: Could this be removed from the main critics class?


DEFAULT_CLARIFIER

public static final Icon DEFAULT_CLARIFIER
The icon representing the resource.


clarifier

private Icon clarifier

decisionCategory

private String decisionCategory
The decision category that this critic is relevant to. The idea of each critic being relevant to exactly one type of decision is a very simple one. Subclasses that have more sophisticated decision relevance logic should override isRelevantToDecisions. You can also define new ControlMech's.

Decision categories are defined in the DecisionModel of a particular domain.

See Also:
ControlMech

supportedDecisions

private Vector supportedDecisions

supportedGoals

private Vector supportedGoals

criticType

private String criticType
The decision type of this critic. For example, correctness, completeness, consistency, alternative, presentation, optimization, organizational, tool critics, etc.


isActive

private boolean isActive
Internal flag that stores the end result of all ControlMech evaluations of this critic.


controlRecs

private Hashtable controlRecs
Control records used in determining if this Critic should be active.


knowledgeTypes

private org.tigris.gef.util.VectorSet knowledgeTypes

triggerMask

private long triggerMask

numCriticsFired

private static int numCriticsFired
Constructor Detail

Critic

public Critic()
Construct a new critic instance. Typically only one instance of each critic class is created and stored in a static variable, as per the Singleton pattern. Each domain extension should define a static initializer block to make one instance of each critic and call Agency.register(java.lang.String, java.lang.String) with that instance.

Method Detail

defaultMoreInfoURL

public final String defaultMoreInfoURL()
This function calculates the default url to describe this critic. This syntax is synchronized with:
  1. Tags in the manual.
  2. Name of the ArgoUML site.
  3. How the manual is deployed on the site.
so this must be updated when any of these change.

Returns:
the url in string format

getCriticKey

public ConfigurationKey getCriticKey()
Returns the ConfigurationKey that the critic uses to determine if it is enabled or disabled.

The string resulting from the ConfigurationKey argo.critic.critic_category.critic_name.

critic_category would describe the type of critic and is taken from getCriticCategory().

critic_name would describe the function of the critic and is taken from getCriticName().

Some examples:

Returns:
the key
Since:
0.9.4
See Also:
Configuration.makeKey(java.lang.String), getCriticCategory(), getCriticName()

getCriticCategory

public String getCriticCategory()
Returns a default critic category. Critics should override this to provide specific classification information.

Returns:
a default category
Since:
0.9.4

getCriticName

public String getCriticName()
Returns a default critic name. By default this is the simple class name. Critic implementations should override this to provide a better (more descriptive) string.

Returns:
a default critic name
Since:
0.9.4

critique

public void critique(Object dm,
                     Designer dsgr)
Examine the given Object and Designer and, if appropriate, produce one or more ToDoItem's and add them to the offending design material's and the Designer's ToDoList. By default this is basically a simple if-statement that relies on predicate() to determine if there is some appropriate feedback, and toDoItem() to produce the ToDoItem. The predicate() and toDoItem() pair of methods is simple and convient for many critics. More sophisticated critics that produce more than one ToDoItem per critiquing, or that produce ToDoItem's that contain information that was already computed in the predicate, should override critique. If you override this method, you should call super.critique().

Parameters:
dm - the design material
dsgr - the designer
See Also:
predicate(java.lang.Object, org.argouml.cognitive.Designer), toDoItem(java.lang.Object, org.argouml.cognitive.Designer)

postItem

public void postItem(ToDoItem item,
                     Object dm,
                     Designer dsgr)
Parameters:
item - the todo item
dm - the designmaterial
dsgr - the designer

predicate

public boolean predicate(Object dm,
                         Designer dsgr)
Perform the Critic's analysis of the design. Subclasses should test the given Object to make sure that it is the type of object that is expected. Each object in the design registers its own critics with the run-time system. The dm parameter is bound to each design object that registered this critic, one per call. Returning true means that feedback should be delivered to the Designer. By convention, subclasses should return their superclass predicate method if their own predicate would return false.

Parameters:
dm - the design material, which is to be checked
dsgr - the designer
Returns:
the critic result

stillValid

public boolean stillValid(ToDoItem i,
                          Designer dsgr)
Return true iff the given ToDoItem is still valid and should be kept in the given designers ToDoList. Critics that are not enabled should always return false so that their ToDoItems will be removed. Subclasses of Critic that supply multiple offenders should always override this method.

By default this method basically asks the critic to again critique the offending Object and then it checks if the resulting ToDoItem is the same as the one already posted. This is simple and it works fine for light-weight critics. Critics that expend a lot of computational effort in making feedback that can be easily check to see if it still holds, should override this method.

TODO: Maybe ToDoItem should carry some data to make this method more efficient.

Specified by:
stillValid in interface Poster
Parameters:
i - the todo item
dsgr - the designer
Returns:
true if thisitem is still valid
See Also:
Poster.stillValid( org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)

supports

public boolean supports(Decision d)
Specified by:
supports in interface Poster
Parameters:
d - the decision
Returns:
true if the decision is still supported
See Also:
Poster.supports(org.argouml.cognitive.Decision)

getSupportedDecisions

public Vector getSupportedDecisions()
Specified by:
getSupportedDecisions in interface Poster
Returns:
the list of supported decisions
See Also:
Poster.getSupportedDecisions()

addSupportedDecision

public void addSupportedDecision(Decision d)
Parameters:
d - the decision

supports

public boolean supports(Goal g)
Specified by:
supports in interface Poster
Parameters:
g - the goal
Returns:
true if the goal is still supported
See Also:
Poster.supports(org.argouml.cognitive.Goal)

getSupportedGoals

public Vector getSupportedGoals()
Specified by:
getSupportedGoals in interface Poster
Returns:
the list of supported goals
See Also:
Poster.getSupportedGoals()

addSupportedGoal

public void addSupportedGoal(Goal g)
Parameters:
g - the goal

containsKnowledgeType

public boolean containsKnowledgeType(String type)
Specified by:
containsKnowledgeType in interface Poster
Parameters:
type - the knowledge type
Returns:
true if it is valid
See Also:
Poster.containsKnowledgeType(java.lang.String)

addKnowledgeType

public void addKnowledgeType(String type)
Parameters:
type - the knowledgetype

getKnowledgeTypes

public org.tigris.gef.util.VectorSet getKnowledgeTypes()
Returns:
the knowledgetypes

setKnowledgeTypes

public void setKnowledgeTypes(org.tigris.gef.util.VectorSet kt)
Parameters:
kt - the knowledgetypes

setKnowledgeTypes

public void setKnowledgeTypes(String t1)
Reset all knowledgetypes, and add the given one.

Parameters:
t1 - the only knowledgetype in string format

setKnowledgeTypes

public void setKnowledgeTypes(String t1,
                              String t2)
Reset all knowledgetypes, and add the given ones.

Parameters:
t1 - a knowledgetype in string format
t2 - a knowledgetype in string format

setKnowledgeTypes

public void setKnowledgeTypes(String t1,
                              String t2,
                              String t3)
Reset all knowledgetypes, and add the given ones.

Parameters:
t1 - a knowledgetype in string format
t2 - a knowledgetype in string format
t3 - a knowledgetype in string format

reasonCodeFor

public static int reasonCodeFor(String s)
Parameters:
s - the reason
Returns:
the code for the given reason

getTriggerMask

public long getTriggerMask()
Returns:
the trigger mask

addTrigger

public void addTrigger(String s)
Parameters:
s - the trigger to be added (is ORed into the mask)

matchReason

public boolean matchReason(long patternCode)
Parameters:
patternCode - the mask to be checked
Returns:
true if it matches a trigger

expand

public String expand(String desc,
                     org.tigris.gef.util.VectorSet offs)
Description copied from interface: Poster
Customize the description string just before it is displayed.

Specified by:
expand in interface Poster
Parameters:
desc - the description
offs - the offenders
Returns:
the customized/expanded string
See Also:
Poster.expand(java.lang.String, org.tigris.gef.util.VectorSet)

getClarifier

public Icon getClarifier()
Specified by:
getClarifier in interface Poster
Returns:
the icon shown on the todo item to show the wizard's progress
See Also:
Poster.getClarifier()

isActive

public boolean isActive()
Reply true iff this Critic can execute. This fact is normally determined by a ControlMech.

Returns:
true iff this Critic can execute

beActive

public void beActive()
Make this critic active. From now on it can be applied to a design material in critiquing.


beInactive

public void beInactive()
Make this critic inactive. From now on it will be idle and will not be applied to a design material in critiquing.


addControlRec

public Object addControlRec(String name,
                            Object controlData)
Add some attribute used by ControlMech to determine if this Critic should be active. Critics store control record so that stateful ControlMech's do not need to store a parallel data structure. But Critic's do not directy use or modify this data.

Parameters:
name - the key
controlData - the value
Returns:
the previous value of the specified key in this hashtable, or null if it did not have one

getControlRec

public Object getControlRec(String name)
Reply the named control record, or null if not defined.

Parameters:
name - the key
Returns:
the value

isEnabled

public boolean isEnabled()
This is a convient method for accessing one well-known control record. The enabled control record is a boolean that the user can turn on or off to manually enable or disable this Critic. It is normally combined with other ControlMech determinations with a logic-and.

Returns:
true if enabled

setEnabled

public void setEnabled(boolean e)
Parameters:
e - the value to be set for the key ENABLED

snoozeOrder

public SnoozeOrder snoozeOrder()
Reply the SnoozeOrder that is defined for this critic.

Returns:
the snooze order

snooze

public void snooze()
Disable this Critic for the next few minutes.

Specified by:
snooze in interface Poster

unsnooze

public void unsnooze()
Lift any previous SnoozeOrder.

Specified by:
unsnooze in interface Poster

isRelevantToDecisions

public boolean isRelevantToDecisions(Designer dsgr)
Reply true if this Critic is relevant to the decisions that the Designer is considering. By default just asks the Designer if he/she is considering my decisionCategory. Really this is something for a ControlMech to compute, but if a subclass of Critic encapsulates some information you may need to override this method.

Parameters:
dsgr - the designer
Returns:
true if relevant

isRelevantToGoals

public boolean isRelevantToGoals(Designer dsgr)
Reply true iff this Critic is relevant to the goals that the Designer is trying to achieve. By default, all Critic's are relevant regardless of the GoalModel. Really this is something for a ControlMech to compute, but if a subclass of Critic encapsulates some information you may need to override this method.

TODO: I would like a better default action, but goals are typed and their values must be interperted by critics. They are not as generic as the DecisionModel.

Parameters:
dsgr - the designer
Returns:
true if relevant

makeWizard

public Wizard makeWizard(ToDoItem item)
Create a new Wizard to help the user fix the identified problem. This version assumes subclasses override getWizClass to return the appropriate Class of wizard. Critic subclasses that need to initialize their wizard might override this to call super.makeWizard() and then work with the result.

Parameters:
item - the todo item
Returns:
the wizard

getWizardClass

public Class getWizardClass(ToDoItem item)
Return the Class of wizard that can fix the problem identifed by this critic. This method returns null, subclasses with wizards should override it.

Parameters:
item - the todo item
Returns:
null if no wizard is defined.

initWizard

public void initWizard(Wizard w)
Initialize a newly created wizard with information found by the critic. This is called right after the wizard is made in makeWizard() and after the wizard's ToDoItem is set. Any critic that supports wizards should probably override this method, and call super initWizard() first.

Parameters:
w - the wizard

getDecisionCategory

public String getDecisionCategory()
Reply a string used to determine if this critic would be relevant to current design decisions. Strings returned from here are compared to strings in the DecisionModel.

Returns:
the decision category

setDecisionCategory

protected void setDecisionCategory(String c)
Set the decisionCategory, usually done in the constructor. I have not yet thought of a case where dynamically changing the Critic's decisionCategory is useful.

Parameters:
c - the category

getCriticType

public String getCriticType()
Reply a string used to contol critics according to type. Examples include: correctness, completeness, consistency, optimization, presentation, and alternative.

Returns:
the critic knowledge type

getExpertEmail

public String getExpertEmail()
Reply the email address of the person who is the author or maintainer of this critic.

Specified by:
getExpertEmail in interface Poster
Returns:
the email address of the poster
See Also:
Poster.getExpertEmail()

setExpertEmail

public void setExpertEmail(String addr)
Set the email address of the person who is the author or maintainer of this critic.

Specified by:
setExpertEmail in interface Poster
Parameters:
addr - the emailaddress
See Also:
Poster.setExpertEmail(java.lang.String)

getHeadline

public String getHeadline(Object dm,
                          Designer dsgr)
Reply the headline used in feedback produced by this Critic.

Parameters:
dm - the design material
dsgr - the designer
Returns:
the headline

getHeadline

public String getHeadline(org.tigris.gef.util.VectorSet offenders,
                          Designer dsgr)
Reply the headline used in feedback produced by this Critic.

Parameters:
offenders - the set of offenders
dsgr - the designer
Returns:
the headline

getHeadline

public String getHeadline()
Reply the headline used in feedback produced by this Critic.

Returns:
the headline

setHeadline

public void setHeadline(String h)
Set the headline used in feedback produced by this Critic.

Parameters:
h - the headline

getPriority

public int getPriority(org.tigris.gef.util.VectorSet offenders,
                       Designer dsgr)
Reply the priority used in feedback produced by this Critic.

Parameters:
offenders - the offenders
dsgr - the designer
Returns:
the priority

setPriority

public void setPriority(int p)
Parameters:
p - the priority

getPriority

public int getPriority()
Returns:
the priority

getDescription

public String getDescription(org.tigris.gef.util.VectorSet offenders,
                             Designer dsgr)
Reply the description used in feedback produced by this Critic.

Parameters:
offenders - the offenders
dsgr - the designer
Returns:
the description

setDescription

public void setDescription(String d)
Parameters:
d - the description

getDescriptionTemplate

public String getDescriptionTemplate()
Returns:
the description

getMoreInfoURL

public String getMoreInfoURL(org.tigris.gef.util.VectorSet offenders,
                             Designer dsgr)
Reply the moreInfoURL used in feedback produced by this Critic.

Parameters:
offenders - the offenders
dsgr - the designer
Returns:
the more-info-url

setMoreInfoURL

public void setMoreInfoURL(String m)
Parameters:
m - the more-info-url

getMoreInfoURL

public String getMoreInfoURL()
Returns:
the more-info-url

setArg

protected void setArg(String name,
                      Object value)
Parameters:
name - the key
value - the value

getArg

protected Object getArg(String name)
Parameters:
name - the key
Returns:
the value

getArgs

public Hashtable getArgs()
Returns:
the (key, value) pairs

setArgs

public void setArgs(Hashtable h)
Parameters:
h - the new table of (key, value) pairs

toDoItem

public ToDoItem toDoItem(Object dm,
                         Designer dsgr)
Reply the ToDoItem that the designer should see iff predicate() returns true. By default it just fills in the fields of the ToDoItem from accessor methods of this Critic. Critic Subclasses may override this method or the accessor methods to add computed fields to the ToDoItem. TODO: Critic's may want to add new fields to a ToDoItem to make stillValid more efficent.

See Also:
critique(java.lang.Object, org.argouml.cognitive.Designer)

canFixIt

public boolean canFixIt(ToDoItem item)
TODO: Not implemented yet. The idea is that some problems identified by Critic's can be fixed with certain design manipulations (or transforms) that can be applied automatically to resolve the problem. This method replies true iff the given problem can be fixed. The fixIt() method actually does the fix.

Specified by:
canFixIt in interface Poster
Parameters:
item - the todo item
Returns:
true if it can be fixed
See Also:
fixIt(org.argouml.cognitive.ToDoItem, java.lang.Object)

fixIt

public void fixIt(ToDoItem item,
                  Object arg)
TODO: Not implemented yet. If the given ToDoItem can be fixed automatically, and the user wants that to happen, then do it. Obviously, this depends on the specific Critic and problem. By default this method does nothing.

Specified by:
fixIt in interface Poster
Parameters:
item - the todo item
arg - the design material (?)
See Also:
canFixIt(org.argouml.cognitive.ToDoItem)

toString

public String toString()
Reply a string that describes this Critic. Identical to getCriticName()

See Also:
Object.toString()


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook