The 1000 steps program to MDriven Chapter 1
No edit summary
No edit summary
Line 1: Line 1:
This is Chapter 1 of the 1000 Steps Program where you will master the steps in a gradual and detailed manner. Each step has been carefully thought out for easy understanding and progress.  
This is '''Chapter 1''' of the ''1000 Steps Program'' where you will master the steps in a gradual and detailed manner. Each step has been carefully thought out for easy understanding and progress.  


Whenever you lose your way, you can backtrack to a step that touches upon your current main point and follow along from there.
Whenever you lose your way, you can backtrack to a step that touches upon your current main point and follow along from there.
Line 32: Line 32:
|-
|-
|Association
|Association
|Association/relation, cardinality/multiplicity, autodiagram
|Association/relation, Cardinality/multiplicity, Autodiagram
|[https://www.youtube.com/embed/Z_jLDZMafXk?start=666 Association at 11:06]
|[https://www.youtube.com/embed/Z_jLDZMafXk?start=666 Association at 11:06]
|-
|-
Line 42: Line 42:
=== Start MDrivenDesigner, Basic Modelling, Classes, and Associations, Press Play ===
=== Start MDrivenDesigner, Basic Modelling, Classes, and Associations, Press Play ===


1. Start MDrivenDesigner by clicking the "clickonce" link on https://mdriven.net/designer.
1. Start MDrivenDesigner by clicking the "ClickOnce" link on https://mdriven.net/designer.


2. Create a new empty model. Save the file as <code>c:\temp\MDrivenEducation\Start.modlr</code> or equivalent.
2. Create a new empty model. Save the file as <code>c:\temp\MDrivenEducation\Start.modlr</code> or equivalent.


3. Create a class <code>Person</code> and save the model; from now on, save the model often, using "ctrl+s."
3. Create a class <code>Person</code> and save the model; from now on, save the model often, using "CTRL + S."


4. Create an attribute <code>Name</code> of type string in class <code>Person</code>.
4. Create an attribute <code>Name</code> of type string in class <code>Person</code>.


5. Press Play - choose XML persistence - Start system - Show debugger
5. Press Play. Choose XML persistence. Select "Start system" then "Show debugger".


6. In the debugger, in an Expression box, write the OCL expression to show all instances of your class Person with the operator allinstances; note the empty result list - you have no Person objects.
6. In the debugger, in an Expression box, write the OCL expression to show all instances of your class Person with the operator <code>allinstances</code>; note the empty result list - you have no Person objects.


7. In the debugger, bring up a seeker, search -> empty. Create 2 person objects.
7. In the debugger, bring up a Seeker, search -> empty. Create 2 person objects.


8. In the AutoForm for person 1, give it your name; in person 2, write some other name.
8. In the AutoForm for person 1, give it your name; in person 2, write some other name.
Line 64: Line 64:
11. Open the XML file with Notepad or another app, find your name, and close the file.
11. Open the XML file with Notepad or another app, find your name, and close the file.


12. In the debugger expression box, use the expression to find all persons from step 6 - note the result - two rows.
12. In the debugger expression box, use the expression to find all persons from step 6. Note the result - two rows.


13. Close the Debugger, close the Play dialog, and close MDrivenDesigner. Save, if asked, then restart by performing step 1.
13. Close the Debugger, close the Play dialog, and close MDrivenDesigner. Save, if asked, then restart by performing step 1.
Line 72: Line 72:
15. Perform step 12. Ensure your 2 person-objects survived.
15. Perform step 12. Ensure your 2 person-objects survived.


16. Close the Debugger and close play-dialog(system prototyper).
16. Close the Debugger and close the play-dialog(system prototyper).


17. Find class Person in Tree to the right by filling in the search box on top of the tree.
17. Find the class <code>Person</code> in Tree to the right by filling in the search box on top of the tree.


18. Note 2 rows: one is the class, and the other result is the property. Select Person class in the tree - look at the property inspector below the tree. Change its default color to cyan (or whatever looks nice).
18. Note 2 rows: one is the class, and the other result is the property. Select <code>Person</code> class in the tree. Look at the property inspector below the tree. Change its default color to cyan (or whatever looks nice).


19. In the search box, press escape or clear search box - note the tree structure of the entire model in the tree. You can always find things in the model here.
19. In the search box, press escape or clear search box - note the tree structure of the entire model in the tree. You can always find things in the model here.
Line 82: Line 82:
20. Find diagram1 in the tree - double click to open.
20. Find diagram1 in the tree - double click to open.


21. Diagram1 may be empty - drag and drop Person class from tree onto diagram.
21. Diagram1 may be empty - drag and drop Person class from Tree onto diagram.


22. Press the "Start!" in the top left corner to show Start-wizard if it does not already show.
22. Press the "Start!" in the top left corner to show Start-wizard, if it does not already show.


23. Right-click the diagram. Choose "Add class."
23. Right-click the diagram. Choose "Add class."


24. Rename the new class to Car.
24. Rename the new class to <code>Car</code>.


25. Use zoom buttons or ctr-wheel to zoom in on your diagram.
25. Use zoom buttons or ctr-wheel to zoom in on your diagram.
Line 94: Line 94:
26. Enter AssociationMode by pressing the association arrow in the tool button.
26. Enter AssociationMode by pressing the association arrow in the tool button.


27. Click-drag-hold association from Person - hold mouse - move to Car - release.
27. Click-drag-hold association from <code>Person</code> - hold mouse - move to Car - release.


28. Rename the "Cars" association-end name to "CarsIUsedToOwn." Make sure it has cardinality 0..* (zero to many).
28. Rename the <code>Cars</code> association-end name to <code>CarsIUsedToOwn</code>. Make sure it has cardinality 0..* (zero to many).


29. Rename the "Person" association-end name to "PreviousOwner." Make sure it has cardinality 0..1 (zero or one).
29. Rename the <code>Person</code> association-end name to <code>PreviousOwner</code>. Make sure it has cardinality 0..1 (zero or one).


30. Add an attribute to class Car with the name "RegistrationNumber" of type string.
30. Add an attribute to class Car with the name <code>RegistrationNumber</code> of type string.


31. Find the Car in the tree by using the search box.
31. Find the <code>Car</code> in the tree by using the search box.


32. Double-click the Car in the tree; note that the screen is not your diagram - it is an auto diagram.
32. Double-click the <code>Car</code> in the tree; note that the screen is not your diagram - it is an auto diagram.


33. Note the link in the auto diagram to class Person - click class Person. Note, also, the auto diagram shift to center Person and show Car on the side.
33. Note the link in the auto diagram to class <code>Person</code> . Click class <code>Person</code>. Note, also, the auto diagram shift to center <code>Person</code> and show <code>Car</code> on the side.


34. Find your way back to the diagram1 by finding it in the tree.
34. Find your way back to the diagram1 by finding it in the tree.
Line 114: Line 114:
36. Click on the person with your name.
36. Click on the person with your name.


37. Note the new multilink button for CarsIUsedToOwn - click it.
37. Note the new multilink button for <code>CarsIUsedToOwn</code> - click it.


38. Use add new button to create 3 cars I used to own.
38. Use add new button to create 3 cars I used to own.

Revision as of 08:14, 15 May 2023

This is Chapter 1 of the 1000 Steps Program where you will master the steps in a gradual and detailed manner. Each step has been carefully thought out for easy understanding and progress.

Whenever you lose your way, you can backtrack to a step that touches upon your current main point and follow along from there.

Here is the video for Steps 1 - 40: https://youtu.be/Z_jLDZMafXk

Video 1: Mdriven Education Steps 1 - 40: The Basics

Title Content Time(Segment Start)
Introduction Introduction
Getting started Download Mdriven Designer, create a new file, and save. Getting started at 00:42
Class, attribute, debugger Create a class and create an attribute, using the debugger Class, attribute, debugger at 2:10
Seeker and objects Seeker, create objects Seeker and objects at 5:08
Search Search function, tree, and right-side menu Search at 9:22
Association Association/relation, Cardinality/multiplicity, Autodiagram Association at 11:06
Multilink Multilink Multilink at 17:00

Start MDrivenDesigner, Basic Modelling, Classes, and Associations, Press Play

1. Start MDrivenDesigner by clicking the "ClickOnce" link on https://mdriven.net/designer.

2. Create a new empty model. Save the file as c:\temp\MDrivenEducation\Start.modlr or equivalent.

3. Create a class Person and save the model; from now on, save the model often, using "CTRL + S."

4. Create an attribute Name of type string in class Person.

5. Press Play. Choose XML persistence. Select "Start system" then "Show debugger".

6. In the debugger, in an Expression box, write the OCL expression to show all instances of your class Person with the operator allinstances; note the empty result list - you have no Person objects.

7. In the debugger, bring up a Seeker, search -> empty. Create 2 person objects.

8. In the AutoForm for person 1, give it your name; in person 2, write some other name.

9. Save the created Person objects from the save button in the debugger.

10. Find the saved XML file on disk in the same location as your model file.

11. Open the XML file with Notepad or another app, find your name, and close the file.

12. In the debugger expression box, use the expression to find all persons from step 6. Note the result - two rows.

13. Close the Debugger, close the Play dialog, and close MDrivenDesigner. Save, if asked, then restart by performing step 1.

14. Open recent files - your file, press play, and go into the Debugger as in step 5.

15. Perform step 12. Ensure your 2 person-objects survived.

16. Close the Debugger and close the play-dialog(system prototyper).

17. Find the class Person in Tree to the right by filling in the search box on top of the tree.

18. Note 2 rows: one is the class, and the other result is the property. Select Person class in the tree. Look at the property inspector below the tree. Change its default color to cyan (or whatever looks nice).

19. In the search box, press escape or clear search box - note the tree structure of the entire model in the tree. You can always find things in the model here.

20. Find diagram1 in the tree - double click to open.

21. Diagram1 may be empty - drag and drop Person class from Tree onto diagram.

22. Press the "Start!" in the top left corner to show Start-wizard, if it does not already show.

23. Right-click the diagram. Choose "Add class."

24. Rename the new class to Car.

25. Use zoom buttons or ctr-wheel to zoom in on your diagram.

26. Enter AssociationMode by pressing the association arrow in the tool button.

27. Click-drag-hold association from Person - hold mouse - move to Car - release.

28. Rename the Cars association-end name to CarsIUsedToOwn. Make sure it has cardinality 0..* (zero to many).

29. Rename the Person association-end name to PreviousOwner. Make sure it has cardinality 0..1 (zero or one).

30. Add an attribute to class Car with the name RegistrationNumber of type string.

31. Find the Car in the tree by using the search box.

32. Double-click the Car in the tree; note that the screen is not your diagram - it is an auto diagram.

33. Note the link in the auto diagram to class Person . Click class Person. Note, also, the auto diagram shift to center Person and show Car on the side.

34. Find your way back to the diagram1 by finding it in the tree.

35. Play-button, XML persistence, debugger, Expression to list allinstances of Person.

36. Click on the person with your name.

37. Note the new multilink button for CarsIUsedToOwn - click it.

38. Use add new button to create 3 cars I used to own.

39. Click up the auto form for each car; give them registrationNumber OldCar1 to OldCar3.

40. Save the debugger data.

Next Chapter

The_1000_steps_program_to_MDriven_Chapter_2

This page was edited 1 days ago on 05/16/2024. What links here