|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.argouml.cognitive.critics.Critic
"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.
| Field Summary | |
static Icon |
DEFAULT_CLARIFIER
The icon representing the resource. |
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. |
static boolean |
NO_PROBLEM
NO_PROBLEM is used for the result of the check of a critic. |
static boolean |
PROBLEM_FOUND
PROBLEM_FOUND is used for the result of the check of a critic. |
| 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,
ListSet 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(ListSet 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(ListSet offenders,
Designer dsgr)
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. |
ListSet |
getKnowledgeTypes()
|
String |
getMoreInfoURL()
|
String |
getMoreInfoURL(ListSet offenders,
Designer dsgr)
Reply the moreInfoURL used in feedback produced by this Critic. |
int |
getPriority()
|
int |
getPriority(ListSet 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(ListSet kt)
|
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 |
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 |
public static final boolean PROBLEM_FOUND
public static final boolean NO_PROBLEM
public static final String KT_DESIGNERS
public static final String KT_CORRECTNESS
public static final String KT_COMPLETENESS
public static final String KT_CONSISTENCY
public static final String KT_SYNTAX
public static final String KT_SEMANTICS
public static final String KT_OPTIMIZATION
public static final String KT_PRESENTATION
public static final String KT_ORGANIZATIONAL
public static final String KT_EXPERIENCIAL
public static final String KT_TOOL
public static final Icon DEFAULT_CLARIFIER
| Constructor Detail |
public Critic()
Agency.register(Critic, Object) with that instance.
| Method Detail |
public final String defaultMoreInfoURL()
public ConfigurationKey getCriticKey()
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:
Configuration.makeKey(String,
String, String),
getCriticCategory(),
getCriticName()public String getCriticCategory()
public String getCriticName()
public void critique(Object dm,
Designer dsgr)
dm - the design materialdsgr - the designerpredicate(java.lang.Object, org.argouml.cognitive.Designer),
toDoItem(java.lang.Object, org.argouml.cognitive.Designer)
public void postItem(ToDoItem item,
Object dm,
Designer dsgr)
item - the todo itemdm - the designmaterial/offender to be informeddsgr - the designer
public boolean predicate(Object dm,
Designer dsgr)
dm - the design material, which is to be checkeddsgr - the designer
public boolean stillValid(ToDoItem i,
Designer dsgr)
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.
stillValid in interface Posteri - the todo itemdsgr - the designer
Poster.stillValid(
org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)public boolean supports(Decision d)
supports in interface Posterd - the decision
Poster.supports(org.argouml.cognitive.Decision)public Vector getSupportedDecisions()
getSupportedDecisions in interface PosterPoster.getSupportedDecisions()public void addSupportedDecision(Decision d)
d - the decisionpublic boolean supports(Goal g)
supports in interface Posterg - the goal
Poster.supports(org.argouml.cognitive.Goal)public Vector getSupportedGoals()
getSupportedGoals in interface PosterPoster.getSupportedGoals()public void addSupportedGoal(Goal g)
g - the goalpublic boolean containsKnowledgeType(String type)
containsKnowledgeType in interface Postertype - the knowledge type
Poster.containsKnowledgeType(java.lang.String)public void addKnowledgeType(String type)
type - the knowledgetypepublic ListSet getKnowledgeTypes()
public void setKnowledgeTypes(ListSet kt)
kt - the knowledgetypespublic void setKnowledgeTypes(String t1)
t1 - the only knowledgetype in string format
public void setKnowledgeTypes(String t1,
String t2)
t1 - a knowledgetype in string formatt2 - a knowledgetype in string format
public void setKnowledgeTypes(String t1,
String t2,
String t3)
t1 - a knowledgetype in string formatt2 - a knowledgetype in string formatt3 - a knowledgetype in string formatpublic static int reasonCodeFor(String s)
s - the reason
public long getTriggerMask()
public void addTrigger(String s)
s - the trigger to be added (is ORed into the mask)public boolean matchReason(long patternCode)
patternCode - the mask to be checked
public String expand(String desc,
ListSet offs)
Poster
expand in interface Posterdesc - the descriptionoffs - the offenders
Poster.expand(java.lang.String, ListSet)public Icon getClarifier()
getClarifier in interface PosterPoster.getClarifier()public boolean isActive()
public void beActive()
public void beInactive()
public Object addControlRec(String name,
Object controlData)
name - the keycontrolData - the value
null
if it did not have onepublic Object getControlRec(String name)
name - the key
public boolean isEnabled()
public void setEnabled(boolean e)
e - the value to be set for the key ENABLEDpublic SnoozeOrder snoozeOrder()
public void snooze()
snooze in interface Posterpublic void unsnooze()
unsnooze in interface Posterpublic boolean isRelevantToDecisions(Designer dsgr)
dsgr - the designer
public boolean isRelevantToGoals(Designer dsgr)
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.
dsgr - the designer
public Wizard makeWizard(ToDoItem item)
item - the todo item
public Class getWizardClass(ToDoItem item)
item - the todo item
public void initWizard(Wizard w)
w - the wizardpublic String getDecisionCategory()
protected void setDecisionCategory(String c)
c - the categorypublic String getCriticType()
public String getExpertEmail()
getExpertEmail in interface PosterPoster.getExpertEmail()public void setExpertEmail(String addr)
setExpertEmail in interface Posteraddr - the emailaddressPoster.setExpertEmail(java.lang.String)
public String getHeadline(Object dm,
Designer dsgr)
dm - the design materialdsgr - the designer
public String getHeadline(ListSet offenders,
Designer dsgr)
offenders - the set of offendersdsgr - the designer
public String getHeadline()
public void setHeadline(String h)
h - the headline
public int getPriority(ListSet offenders,
Designer dsgr)
offenders - the offendersdsgr - the designer
public void setPriority(int p)
p - the prioritypublic int getPriority()
public String getDescription(ListSet offenders,
Designer dsgr)
offenders - the offendersdsgr - the designer
public void setDescription(String d)
d - the descriptionpublic String getDescriptionTemplate()
public String getMoreInfoURL(ListSet offenders,
Designer dsgr)
offenders - the offendersdsgr - the designer
public void setMoreInfoURL(String m)
m - the more-info-urlpublic String getMoreInfoURL()
protected void setArg(String name,
Object value)
name - the keyvalue - the valueprotected Object getArg(String name)
name - the key
public Hashtable getArgs()
public void setArgs(Hashtable h)
h - the new table of (key, value) pairs
public ToDoItem toDoItem(Object dm,
Designer dsgr)
critique(java.lang.Object, org.argouml.cognitive.Designer)public boolean canFixIt(ToDoItem item)
canFixIt in interface Posteritem - the todo item
fixIt(org.argouml.cognitive.ToDoItem, java.lang.Object)
public void fixIt(ToDoItem item,
Object arg)
fixIt in interface Posteritem - the todo itemarg - the design material (?)canFixIt(org.argouml.cognitive.ToDoItem)public String toString()
Object.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2006 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |