Troubleshooting D2W Rules

922 views
788 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
922
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Troubleshooting D2W Rules

  1. 1. Troubleshooting D2W Rules David LeBerAlign Software Inc.
  2. 2. Why, why, Oh why?
  3. 3. “With great power comes great opacity.”
  4. 4. Knowledge is light...• Understand the rules• Understand their sources• Understand the tools
  5. 5. Getting to know the Rules
  6. 6. The Rule Files• user.d2wmodel and d2w.d2wmodel• In your Application• In its Frameworks• Identifying all of the rules at play is critical
  7. 7. Example: ERModernMoviesDemo• ERModernMoviesDemo - user.d2wmodel/d2w.d2wmodel• ERModernLook - d2w.d2wmodel• ERModernDefaultSkin - d2w.d2wmodel• ERModernDirectToWeb - d2w.d2wmodel• ERDirectToWeb - d2w.d2wmodel• JavaDirectToWeb - d2w.d2wmodel
  8. 8. ALL of those rules affect your apps behaviour.
  9. 9. RuleModeler to the rescue
  10. 10. Demo
  11. 11. Anatomy of a Rule100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment] Left Hand Side (LHS) Right Hand Side (RHS)
  12. 12. Your Job ( should you accept it... ) this hard drive will self destruct in...• Determine what LHS condition will identify the point in your app that you want the behaviour to change.• Identify what RHS key controls that behaviour• Identify what value the RHS key needs to be need to be set to.
  13. 13. Why a priority of a million may not be a good idea• Establish priority guidelines• Stray from those guidelines at your peril• Arbitrarily high priorities, probably mean you are doing it wrong
  14. 14. Common Rule Problems• Typos• Conflicting LHS qualifier with rules higher up the hierarchy• Incorrect or non-existent keys
  15. 15. Rule Keys and Values• Components• The d2wContext• Assignment objects• Other rules
  16. 16. Components/*** From ERMODListPage.java** @d2wKey printerButtonComponentName* @d2wKey emptyListComponentName* @d2wKey headerComponentName* @d2wKey entity* @d2wKey allowsFiltering* @d2wKey repetitionComponentName* @d2wKey batchNavigationBarComponentName* @d2wKey displayNameForEntity* @d2wKey pageWrapperName* @d2wKey returnButtonLabel*/
  17. 17. Components100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]
  18. 18. d2wContext• task• entity• propertyKey• attribute• relationship
  19. 19. Assignment Objects100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]100 : entity.name = ‘MovieRole’ => isEntityEditable = “true” [BooleanAssignment]100 : pageConfiguration like ‘*Article*’ => entity = “Article” [EntityAssignment]
  20. 20. Assignment Objects0 : *true* => actions = “defaultActions” [ERDKeyValueAssignment]0 : task = ‘list’ => defaultActions = “<ERDDefaultActionAssignment>” [ERDDefaultActionAssignemnt]// From ERDDefaultActionAssignmentpublic NSDictionary defaultActions(D2WContext c) { NSDictionary actions = new NSDictionary(new Object[] { defaultLeftActions(c), defaultRightActions(c) }, new Object [] {"left", "right"} ); log.debug(actions); return actions;}
  21. 21. Other Rules50 : pageConfiguration like EditList* => subTask = “list” [Assignment]1 : subTask = list => repetitionComponentName = “ERDListPageRepetition” [Assignemnt]
  22. 22. Did you turn it off and back on again?
  23. 23. Did you turn it off and back on again?
  24. 24. Did you turn it off and back on again?
  25. 25. Did you turn it off and back on again?
  26. 26. Demo
  27. 27. Page Configurations• A shortcut to identify a task and entity combination• Naming convetion: TaskModifierEntity• Are easier to read and remember• Are more flexible• Can reduce the number of rules required
  28. 28. Wildcard Gotchas50 : pageConfiguration like ‘*Movie*’ => someKey = “someValue” [Assignment]50 : pageConfiguration like ‘Inspect*Movie*’ => someKey = “someDifferentValue” [Assignment]60 : pageConfiguration like ‘Inspect*Movie*’ => someKey = “someDifferentValue” [Assignment]
  29. 29. Demo
  30. 30. Use the tools Luke
  31. 31. Demo
  32. 32. Q&A

×