Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modeling on the Right Side of the Brain

Modeling on the Right Side of the Brain

Since your first web application, you have struggled with identifying domain objects. Assigning business rules and services appears to be a talent that only other developers are born with. Fear not! Object Modeling is a learnable, teachable skill. This talk demonstrates the five essential skills you need for modeling objects and their responsibilities. Think beyond ActiveRecord and your database, and learn how color and patterns will help you explain, maintain and extend your application.

Nicholas Henry

April 22, 2014
Tweet

More Decks by Nicholas Henry

Other Decks in Programming

Transcript

  1. Modeling on the Right Side of the Brain An introduction

    to the five basic skills of Object Modeling ! Nicholas Henry #motrsb
  2. makeMomentInterval addDetail calcTotal recalcTotal complete cancel mi_generateNext mi_assessWRTPrior mi_assessWRTNext mi_comparePlanVsActual

    listMIs assessAcrossMIs «moment-interval» MomentInterval number dateOrDateTimeOrInterval priority total status «moment-interval» NextMI «moment-interval» PriorMI calcTotal qty «mi-detail» MomentIntervalDetail 0..* 1 0..* 1 Interacts - With its pink mi-details - With its pink prior moment-intervals - With its pink next moment-intervals - With its corresponding yellow roles, green party/place/things, or blue descriptions plan 0..* actual 0..1 1 1..* makeMomentInterval interface «plug-in point» IMakeMomentInterval 1 assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» ThingRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PlaceRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PartyRole 0..* 1 0..* 1 0..* 0..* assessAcrossRoles getCustomElseDefaultValue listRoles listThings assessAcrossThings serialNumber name address customerValue «thing» Thing assessAcrossRoles getCustomElseDefaultValue listRoles listPlaces assessAcrossPlaces serialNumber name address customerValue «place» Place assessWithPlugInElseDefault accessAcrossPlaces findAvailable calcQtyAvailable calcTotalFor listPlaces listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PlaceDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossThings findAvailable calcQtyAvailable calcTotalFor listThings listDescs accessAcrossDescs type description itemNumber defaultNumber «description» ThingDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossParties findAvailable calcQtyAvailable calcTotalFor listParties listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PartyDescription 0..* 1 assess interface «plug-in point» IAssess assessAcrossRoles getCustomElseDefaultValue listRoles listParties assessAcrossThings serialNumber name address customerValue «party» Party Interacts with its yellow roles or its pink moment-intervals Interacts with its green parties or its pink moment-intervals Interacts with its pink moment-intervals 1 0..* 0..1 0..1 1 0..* 1 0..* 0..1 The domain-neutral component. If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just one hello for a green, keep the portioning if useful, else drop the yellow. If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just a category attribute, move the attribute to the green and drop the blue.
  3. makeMomentInterval addDetail calcTotal recalcTotal complete cancel mi_generateNext mi_assessWRTPrior mi_assessWRTNext mi_comparePlanVsActual

    listMIs assessAcrossMIs «moment-interval» MomentInterval number dateOrDateTimeOrInterval priority total status «moment-interval» NextMI «moment-interval» PriorMI calcTotal qty «mi-detail» MomentIntervalDetail 0..* 1 0..* 1 Interacts - With its pink mi-details - With its pink prior moment-intervals - With its pink next moment-intervals - With its corresponding yellow roles, green party/place/things, or blue descriptions plan 0..* actual 0..1 1 1..* makeMomentInterval interface «plug-in point» IMakeMomentInterval 1 assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» ThingRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PlaceRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PartyRole 0..* 1 0..* 1 0..* 0..* assessAcrossRoles getCustomElseDefaultValue listRoles listThings assessAcrossThings serialNumber name address customerValue «thing» Thing assessAcrossRoles getCustomElseDefaultValue listRoles listPlaces assessAcrossPlaces serialNumber name address customerValue «place» Place assessWithPlugInElseDefault accessAcrossPlaces findAvailable calcQtyAvailable calcTotalFor listPlaces listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PlaceDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossThings findAvailable calcQtyAvailable calcTotalFor listThings listDescs accessAcrossDescs type description itemNumber defaultNumber «description» ThingDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossParties findAvailable calcQtyAvailable calcTotalFor listParties listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PartyDescription 0..* 1 assess interface «plug-in point» IAssess assessAcrossRoles getCustomElseDefaultValue listRoles listParties assessAcrossThings serialNumber name address customerValue «party» Party Interacts with its yellow roles or its pink moment-intervals Interacts with its green parties or its pink moment-intervals Interacts with its pink moment-intervals 1 0..* 0..1 0..1 1 0..* 1 0..* 0..1 The domain-neutral component. If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just one hello for a green, keep the portioning if useful, else drop the yellow. If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just a category attribute, move the attribute to the green and drop the blue.
  4. makeMomentInterval addDetail calcTotal recalcTotal complete cancel mi_generateNext mi_assessWRTPrior mi_assessWRTNext mi_comparePlanVsActual

    listMIs assessAcrossMIs «moment-interval» MomentInterval number dateOrDateTimeOrInterval priority total status «moment-interval» NextMI «moment-interval» PriorMI calcTotal qty «mi-detail» MomentIntervalDetail 0..* 1 0..* 1 Interacts - With its pink mi-details - With its pink prior moment-intervals - With its pink next moment-intervals - With its corresponding yellow roles, green party/place/things, or blue descriptions plan 0..* actual 0..1 1 1..* makeMomentInterval interface «plug-in point» IMakeMomentInterval 1 assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» ThingRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PlaceRole assessAcrossMIs listMIs listRoles accessAcrossRoles assignedNumber status «role» PartyRole 0..* 1 0..* 1 0..* 0..* assessAcrossRoles getCustomElseDefaultValue listRoles listThings assessAcrossThings serialNumber name address customerValue «thing» Thing assessAcrossRoles getCustomElseDefaultValue listRoles listPlaces assessAcrossPlaces serialNumber name address customerValue «place» Place assessWithPlugInElseDefault accessAcrossPlaces findAvailable calcQtyAvailable calcTotalFor listPlaces listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PlaceDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossThings findAvailable calcQtyAvailable calcTotalFor listThings listDescs accessAcrossDescs type description itemNumber defaultNumber «description» ThingDescription 0..* 1 assess interface «plug-in point» IAssess assessWithPlugInElseDefault accessAcrossParties findAvailable calcQtyAvailable calcTotalFor listParties listDescs accessAcrossDescs type description itemNumber defaultNumber «description» PartyDescription 0..* 1 assess interface «plug-in point» IAssess assessAcrossRoles getCustomElseDefaultValue listRoles listParties assessAcrossThings serialNumber name address customerValue «party» Party Interacts with its yellow roles or its pink moment-intervals Interacts with its green parties or its pink moment-intervals Interacts with its pink moment-intervals 1 0..* 0..1 0..1 1 0..* 1 0..* 0..1 If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just one hello for a green, keep the portioning if useful, else drop the yellow. If you do not need to track a specific green, then drop the been and the yellow; the blue is enough. If just a category attribute, move the attribute to the green and drop the blue.