Tutorial ======== This tutorial will focus on the mechanics of the tool, assuming you already understand the IDesign Method. Completly abstract terms with no link to a real project will be used Navigating MethodSketch ----------------------- Open MethodSketch ~~~~~~~~~~~~~~~~~ `Open https://pad.methodsketch.app `_ .. image:: _tutorial/MethodSketch.png Subscription and Sketches menu Items require login. If you have not yet setup an account click "register" .. image:: _tutorial/MethodSketchLogin.png An active subscription is required to access the sketch pad if you do not have one press subscribe .. image:: _tutorial/MethodSketchSubscription.png With an active subscription the subscription status will be active .. image:: _tutorial/MethodSketchSubscribed.png Create New ~~~~~~~~~~ With an active subscription select "Sketches" from the menu and then click the button labeled "Create New" .. image:: _tutorial/MethodSketchList.png The button will become a spinner before opening your sketch .. image:: _tutorial/MethodSketchPad.png Names ~~~~~ In the right hand half of the window under the Iterate and Options button you can rename the sketch .. image:: _tutorial/MethodSketchName.png Iterate ~~~~~~~ Click the button labeled "Iterate" to create diagrams from the design input in the text editor window .. image:: _tutorial/MethodSketchIterate.png .. image:: _tutorial/MethodSketchIteration.png .. _generate-label: Generate ~~~~~~~~ .. tip:: You may want to skip this section until you have created your :ref:`system-design-label`. It is included here as the last part of "navigating" the MethodSketch tool. To create a script to generate a Visual Studio solution for your design select "Options" then "Generate". .. image:: _tutorial/MethodSketchGenerate.png The text input into the text box will become the solution file name and the root of the namespace for the generated solution. .. image:: _tutorial/MethodSketchGenerateConfig.png A new window will open (you may need to allow the site to open pop-ups) containing a powershell script to generate the solution structure on your local machine. .. image:: _tutorial/MethodSketchScript.png Save the script to your local machine with a name such as "Generate.ps". Place the script into the folder where you wish to create the project. Make sure you have the `dot net SDK `_ installed then run the powershell command .. code-block:: powershell.exe -executionpolicy bypass .\Generate.ps1 You can then open the solution file in Visual Studio to view the generated project structure .. image:: _tutorial/GeneratedSolutionVisualStudio.png .. _system-design-label: System Design --------------- Anti-Design ~~~~~~~~~~~~~~~~~~~~ Static Aspect ++++++++++++++++++++ Eliminate the blank canvas and carry out the anti design by dumping everything in your mind into a static aspect .. code-block:: StaticAspect "Anti-design" { PersonClient BodyClient EntityClient IndividualClient SubjectClient ConceptManager ConcernManager WidgetManager MatterManager PhenonmenonManager ContrivanceManager SubjectManager SolveEngine DrawEngine BuildEngine AnswerEngine ArrangementEngine ImmitationEngine ApparatusAccess ArticleAccess SubstanceAccess CreatureAccess MachineAccess AppratusResource ArticleResource SubstanceResource CreatureResource MachineResource } .. image:: _tutorial/staticAspectAntiDesign.svg First Iteration ~~~~~~~~~~~~~~~ Static Aspect ++++++++++++++++++++ Based upon the volatitlies create your first Iteration .. code-block:: StaticAspect "Iteration 1" { PublicClient PartnerClient FeedManager PhenonmenonManager AnalyticsManager NotificationManager AnswerEngine ArrangementEngine ImmitationEngine EntityAccess MaterialAccess CreatureResource MachineResource:a ArticleResource:n } .. image:: _tutorial/staticAspectIteration1.svg Call Chains +++++++++++++++++ Create multiple call chains to validate the architecture .. code-block:: UseCase "usecase0" { PublicClient -> PhenonmenonManager -> ImmitationEngine -> EntityAccess EntityAccess -> CreatureResource EntityAccess -> MachineResource ImmitationEngine -> MaterialAccess -> ArticleResource } UseCase "usecase1" { ... } ... UseCase "usecaseN" { ... } .. image:: _tutorial/usecase0callchain.svg .. image:: _tutorial/usecase0sequence.svg Iterate over architecture and call chains ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Carry out multiple iterations eliminating smells and making it your best solution within the timebox .. code-block:: StaticAspect { PublicClient PartnerClient FeedManager PhenonmenonManager AnalyticsManager AnswerEngine ImmitationEngine EntityAccess MaterialAccess CreatureResource MachineResource:a ArticleResource:n PubSubUtility CacheUtility } UseCase "usecase0" { PublicClient -> PhenonmenonManager -> ImmitationEngine -> CacheUtility ImmitationEngine -> EntityAccess EntityAccess -> MachineResource ImmitationEngine -> MaterialAccess -> ArticleResource ImmitationEngine -> CacheUtility PhenonmenonManager -:q> PubSubUtility } UseCase "usecase1" { ... } ... UseCase "usecaseN" { ... } .. image:: _tutorial/iteration3StaticAspect.svg .. image:: _tutorial/iteration3CallChain.svg .. image:: _tutorial/iteration3Sequence.svg Detailed Design --------------- Operation Names ~~~~~~~~~~~~~~~ Working on each layer of your design starting with the managers, create operation names within the use cases .. code-block:: UseCase "..."{ PublicClient - IPhenonmenonManager.Observe() > PhenonmenonManager ... } .. image:: _tutorial/ddOperationNamesObserve.svg .. code-block:: UseCase "..."{ PublicClient - IAnalyticsManager.Summary() > AnalyticsManager ... } .. image:: _tutorial/ddOperationNamesSummary.svg .. code-block:: UseCase "..."{ PublicClient - IAnalyticsManager.Export() > AnalyticsManager ... } .. image:: _tutorial/ddOperationNamesExport.svg .. code-block:: UseCase "..."{ PubSubUtility - INotificationManager.Notify():q > NotificationManager ... } .. image:: _tutorial/ddOperationNamesNotify.svg Move on to the engine layer .. code-block:: UseCase "..."{ ... PhenonmenonManager - IAnswerEngine.Locate() > AnswerEngine ... } .. image:: _tutorial/ddOperationNamesObserveLocate.svg .. code-block:: UseCase "..."{ ... AnalyticsManager - IAnswerEngine.Summarize() > AnswerEngine ... } .. image:: _tutorial/ddOperationNamesSummarySummarize.svg .. code-block:: UseCase "..."{ ... PhenonmenonManager - IImmitationEngine.Mimic() > ImmitationEngine ... } .. image:: _tutorial/ddOperationNamesObserveMimic.svg Repeating the process for the access layer is left as an exercise for the reader DTO Names ~~~~~~~~~ Working through the layers again we can add DTOs to the detailed design .. code-block:: UseCase "..."{ PublicClient - ObservationResponse IPhenonmenonManager.Observe(ObservationRequest ) > PhenonmenonManager PhenonmenonManager - IImmitationEngine.Mimic() > ImmitationEngine } .. image:: _tutorial/dtoObservationRequestResponse.svg .. code-block:: UseCase "..."{ PublicClient - ObservationResponse IPhenonmenonManager.Observe(ObservationRequest ) > PhenonmenonManager PhenonmenonManager - MimicResponse IImmitationEngine.Mimic(MimicRequest) > ImmitationEngine } .. image:: _tutorial/dtoMimicRequestResponse.svg Supporting Polymorphism .. code-block:: UseCase "...Linear"{ PublicClient - ObservationResponse IPhenonmenonManager.Observe(ObserveLinear ) > PhenonmenonManager ... } UseCase "...Parallel"{ PublicClient - ObservationResponse IPhenonmenonManager.Observe(ObserveParallel ) > PhenonmenonManager ... } .. image:: _tutorial/dtoLinear.svg .. image:: _tutorial/dtoParallel.svg Contexts ~~~~~~~~ Extend using contexts for DTOS for calls to the manager .. code-block:: UseCase "...PublicLinear"{ PublicClient - Public.ObservationResponse IPhenonmenonManager.Observe(Public.ObserveLinear ) > PhenonmenonManager ... } UseCase "...PartnerLinear"{ PublicClient - Partner.ObservationResponse IPhenonmenonManager.Observe(Partner.ObserveLinear ) > PhenonmenonManager ... } .. image:: _tutorial/dtoPublicLinear.svg .. image:: _tutorial/dtoPartnerLinear.svg Extend using contexts for Interfaces .. code-block:: UseCase "...PublicLinear"{ ... PhenonmenonManager - MimicResponse Phenonmenon.IImmitationEngine.Mimic(MimicRequest) > ImmitationEngine } .. image:: _tutorial/contextInterface.svg Wrapper ~~~~~~~ Consider using a generic wrapper for Engine responses .. code-block:: UseCase "...PublicLinear"{ ... PhenonmenonManager - Response Phenonmenon.IImmitationEngine.Mimic(MimicRequest) > ImmitationEngine } .. image:: _tutorial/responseWrapper.svg Generate -------- Select :ref:`generate-label` from the options menu and run the script on your local machine. Generate Solution, Projects and DTOs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Visual studio solution structure .. image:: _tutorial/GeneratedDetailedDesignVisualSudio.png Polymorphic contextual DTOs .. image:: _tutorial/GeneratedVisualStudioPolymorphicContextualDtos.png