The 1000 steps program to MDriven Chapter 9
No edit summary
No edit summary
Tag: 2017 source edit
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is chapter nine. Here is the start: [[The 1000 steps program to MDriven]] , [[The 1000 steps program to MDriven Chapter 8|the previous chapter]]
This is '''Chapter 9'''. Here is the first part: [[The 1000 steps program to MDriven Chapter 1|The 1000 steps program to MDriven: Chapter 1]], or see [[The 1000 steps program to MDriven Chapter 8|Chapter 8 (the previous chapter)]]


Video is found here https://youtu.be/MPqx5af3QCM
=== '''Video 9: Inheritance and Statemachines''' ===
<html>


'''Video 9 : MDriven Education Video Chapter 9, inheritance and statemachines'''
<p class="video-warn">
  To make your experience smooth, we set the main tags mentioned in the video to the right bar menu of this mini-player. Choose an interesting subtitle on the list and immediately get to the exact theme navigation item place in the video. Now you can pick any topic to be instructed on without watching the whole video.
</p>


{| class="wikitable"
<div class="video">
|Title
  <div class="video__wrapper">
|Content
    <iframe src="https://www.youtube.com/embed/MPqx5af3QCM?si=7WCEfSXr41UjuDTI" title="YouTube video player" frameborder="0" allowfullscreen></iframe>
|Time(segment start)
  </div>
|-
  <div class="video__navigation">
|Introduction
<span data-video="MPqx5af3QCM" data-start="00" tabindex="0"> <strong> Steps 265 - 301 </strong> </span>
|Introduction
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="00" tabindex="0"> Introduction </span>
|00:00
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="27" tabindex="0"> Aligning items </span>
|-
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="322" tabindex="0"> Inheritance </span>
|Aligning items
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="870" tabindex="0"> Abstract classes </span>
|How to align Items in the  viewmodels
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="1230" tabindex="0"> Repetition </span>
|00:27
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="1647" tabindex="0"> Statemachines </span>
|-
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="1845" tabindex="0"> Triggers and entry </span>
|Inheritance
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="2250" tabindex="0"> Guards </span>
|Generalization mode, inheritance, superclasses,  subclasses
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="2883" tabindex="0"> Class actions for triggers </span>
|05:22
    <span class="navigation-item" data-video="MPqx5af3QCM" data-start="3041" tabindex="0"> Web application example </span>
|-
  </div>
|Abstract classes
</div>
|Abstract classes
|14:30
|-
|Repetition
|More inheritance/repetition
|20:30
|-
|Statemachines
|Statemachines intro, states
|27:27
|-
|Triggers and entry
|Statemachines, triggers and entry  actions
|30:45
|-
|Guards
|Statemachines, guards
|37:30
|-
|Class actions for triggers
|Statemachines, Class actions for  triggers
|48:03
|-
|Webapplication example
|Showing statemachines in the  webapplication
|50:41
|}


In this chapter we introduce UML inheritance and UML state-machines
</html>


==== Chapter 9, Inheritance and statemachines ====
== Chapter 9: Inheritance and Statemachines ==
265 Remove the 20pixel marging on the buttons and apply Align Items property End instead to make everything end up at the bottom line
'''In this chapter, we introduce [[UML Inheritance|UML inheritance]] and [https://wiki.mdriven.net/index.php/UML_%E2%80%93_State_machines UML Statemachines].'''


266 Test out combinations of Justify content and Align Items, and direction to familiarize yourself with ways to control flow of UI-widgets
265. Remove the 20-pixel margin on the buttons and apply the Align Items property end instead, to make everything end up on the bottom line.


267 Introduce the new class CarDealer
266. Test out combinations of Justify content and Align Items, and determine how to familiarize yourself with ways to control the flow of UI widgets.


268 Introduce the new class CarOwner
267. Introduce the new class <code>CarDealer</code>.


269 Add generalization arrows from CarDealer to CarOwner and from Person to CarOwner
268. Introduce the new class <code>CarOwner</code>.


270 Add the Attribute Name:String to CarOwner and save - notif the error . make sure you understand why Name is reported as doublet - fix by remove name of Person
269. Add generalization arrows from CarDealer to CarOwner and from Person to CarOwner.


271 Make sure you understand Subclass and Super class - look up these aericles on the wiki <nowiki>https://wiki.mdriven.net/index.php/UML_Inheritance</nowiki> <nowiki>https://wiki.mdriven.net/index.php/UML_School#Lesson_3:_UML_Inheritance</nowiki>
270. Add the Attribute <code>Name:String</code> to CarOwner and save. 
* Notice the error. 
* Make sure you understand why Name is reported as a doublet. 
* Fix it by removing Name of Person.
271. Make sure you understand Subclass and Superclass. Look up and read through these articles on the Wiki:
* [[UML Inheritance|https://wiki.mdriven.net/index.php/UML_Inheritance]]
* [[UML School|https://wiki.mdriven.net/index.php/UML_School#Lesson_3:_UML_Inheritance]].
272. Add a new association from CarOwner to Car. Name the Cars end as <code>CurrentlyOwnedCars</code>.


272 Add new association from CarOwner to Car - name the Cars end CurrentlyOwnedCars
273. Delete the old link with the currently owned car. Update the autoforms. Save and check for errors. 


273 Delete the old link with currently owned car, update autoforms save and check errors
274. Delete the Combobox that showed the now-removed currently owned car in the Person form.


274 delete the combobox that showed the now removed currently owned car in the Person form
275. Add a new class: <code>CarTransferOwnershipDocument</code>, and add a new association from <code>Car(0..1)</code> to <code>CarTransferOwnershipDocument(*)</code>


275 Add new class CarTransferOwnershipDocument, new association from Car(0..1) to CarTransferOwnershipDocument(*)
276. Add an association from CarOwner to CarTransferOwnershipDocument. Call the link <code>DocumentsForSales(*)</code> and <code>Seller(0..1)</code>


276 Add Association from CarOwner to CarTransferOwnershipDocument, call link DocumentsForSales(*) and Seller(0..1)
277. Add another association from CarOwner to CarTransferOwnershipDocument. Call the link <code>DocumentsForPurchase(*)</code> and <code>Buyer(0..1)</code>


277 Add another Association from CarOwner to CarTransferOwnershipDocument, call link DocumentsForPurchase(*) and Buyer(0..1)
278. Add <code>CarFactory</code> and make it a subclass of CarOwner.


278 Add CarFactory and make it subclass to CarOwner
279. Add <code>ScrapYard</code> and make it a subclass of CarOwner.


279 Add ScrapYard and make it subclass to CarOwner
280. Add a statemachine on Class Car.


280 Add a State machine on Class Car
281. Add a state in the statemachine of the car called <code>BrandNew</code>.


281 Add a State in the statemachine of the car called BrandNew
282. Add another state: <code>InOwnershipTransaction</code>.


282 Add another state InOwnershipTransaction
283. Add a Transition arrow from <code>BrandNew</code> to <code>InOwnershipTransaction</code>.


283 Add a Transition arrow from BrandNew to InOwnershipTransaction
284. Call the trigger of the transition <code>InitiateSale</code>.


284 Call the trigger of the transition InitiateSale
285. Add yet another state called <code>OwnershipStable</code>.


285 Add yet another state called OwnershipStable
286. Add a transition from InOwnershipTransaction to OwnershipStable. Name the trigger <code>CloseSale</code>.


286 Add a transition from InOwnershipTransaction to OwnershipStable, name the trigger CloseSale
287. Add a transition from OwnershipStable to InOwnershipTransaction. Reuse the trigger InitiateSale on this transition.


287 Add a transition from OwnershipStable to InOwnershipTransaction, reuse the trigger InitiateSale on this transition
288. Create an Entry Action in the state InOwnerShipTransaction. 
* Create a <code>CarTransferOwnershipDocument</code> and add it to the cars list of CarTransferOwnershipDocuments. 
* Also, assign the Seller of the new CarTransferOwnershipDocument to the current owner of the Car.
289. Add an association from CarTransferOwnershipDocument to Car. Call the single-end <code>CurrentTransaction</code>. Set the Car's end to not Navigable.


288 Create an Entry Action in state InOwnerShipTransaction, create a CarTransferOwnershipDocument and add it to the cars list of CarTransferOwnershipDocuments, also assign the seller of the new CarTransferOwnershipDocument to the current owner of the Car
290. In the Entry Action, in the state InOwnerShipTransaction, assign the CurrentTransaction to the created document.


289 Add a an association from CarTransferOwnershipDocument to Car, call the single end CurrentTransaction - set the Cars end to not Navigable
291. Go to Guard of CloseSale and check that the current transaction has a Buyer.


290 In the Entry Action in state InOwnerShipTransaction assignmen the CurrentTransation to the created document
292. In the OwnershipStable, add an Entry action that removes the Car from Seller's CurrentlyOwnedCars and adds it to the Buyer's CurrentlyOwnedCars.


291 Go to Guard of CloseSale - and check the currentTransation has a Buyer
293. In the OwnershipStable, add an Entry action and add an update of the Seller's CarsOwnerUsedToOwn.


292 In the OwnershipStable add an Entry action that removes the car from seller currentlyownedcars and add it to the buyer currentlyownedcars
294. On the transition between BrandNew and InOwnerShipTransaction, add a guard that checks that there is a CarOwner.


293 In the OwnershipStable add an Entry action  add an update of the sellers CarsOwnerUsedToOwn
295. On the InitiateSale trigger, add a ClassAction for the trigger.


294 On the transition between BrandNew and InOwnerShipTransaction add a guaurd that check that there is a CarOwner
296. On the CloseSale trigger, add a ClassAction for the trigger.


295 On the InitiateSale trigger - add a ClassAction for trigger
297. Refresh the AutoForms.


296 On the CloseSale trigger - add a ClassAction for trigger
298. Save and test on the web.
* Create a <code>CarFactory</code>.
* Call it BWM in Munich.
* Add a Car to this CarFactory.
299. Initiate the Sale and check that you get a CarTransferOwnershipDocument.


297 Refresh the AutoForms
300. Assign a buyer in the CarTransferOwnershipDocument, then close the Sale. Check that ownership has switched.


298 Save and test on the web, Create a CarFactory, call it BWM in Munich, Add a Car to this CarFactory
301. Set the default representation of CarOwner to <code>self.Name</code>


299 Initiate the Sale, check that you get a CarTransferOwnershipDocument
'''Next Chapter'''


300 Assign a buyer in the CarTransferOwnershipDocument, then close the sale, check that owner is switched
[[The 1000 steps program to MDriven Chapter 10|The_1000_steps_program_to_MDriven_Chapter_10]]
 
301 Set the default representation of CarOwner to self.Name
 
[[The 1000 steps program to MDriven Chapter 10|Chapter 10]]
[[Category:1000 Steps Program]]
[[Category:1000 Steps Program]]

Latest revision as of 06:17, 12 April 2024

This is Chapter 9. Here is the first part: The 1000 steps program to MDriven: Chapter 1, or see Chapter 8 (the previous chapter)

Video 9: Inheritance and Statemachines

To make your experience smooth, we set the main tags mentioned in the video to the right bar menu of this mini-player. Choose an interesting subtitle on the list and immediately get to the exact theme navigation item place in the video. Now you can pick any topic to be instructed on without watching the whole video.

Steps 265 - 301 Introduction Aligning items Inheritance Abstract classes Repetition Statemachines Triggers and entry Guards Class actions for triggers Web application example

Chapter 9: Inheritance and Statemachines

In this chapter, we introduce UML inheritance and UML Statemachines.

265. Remove the 20-pixel margin on the buttons and apply the Align Items property end instead, to make everything end up on the bottom line.

266. Test out combinations of Justify content and Align Items, and determine how to familiarize yourself with ways to control the flow of UI widgets.

267. Introduce the new class CarDealer.

268. Introduce the new class CarOwner.

269. Add generalization arrows from CarDealer to CarOwner and from Person to CarOwner.

270. Add the Attribute Name:String to CarOwner and save.

  • Notice the error.
  • Make sure you understand why Name is reported as a doublet.
  • Fix it by removing Name of Person.

271. Make sure you understand Subclass and Superclass. Look up and read through these articles on the Wiki:

272. Add a new association from CarOwner to Car. Name the Cars end as CurrentlyOwnedCars.

273. Delete the old link with the currently owned car. Update the autoforms. Save and check for errors.

274. Delete the Combobox that showed the now-removed currently owned car in the Person form.

275. Add a new class: CarTransferOwnershipDocument, and add a new association from Car(0..1) to CarTransferOwnershipDocument(*)

276. Add an association from CarOwner to CarTransferOwnershipDocument. Call the link DocumentsForSales(*) and Seller(0..1)

277. Add another association from CarOwner to CarTransferOwnershipDocument. Call the link DocumentsForPurchase(*) and Buyer(0..1)

278. Add CarFactory and make it a subclass of CarOwner.

279. Add ScrapYard and make it a subclass of CarOwner.

280. Add a statemachine on Class Car.

281. Add a state in the statemachine of the car called BrandNew.

282. Add another state: InOwnershipTransaction.

283. Add a Transition arrow from BrandNew to InOwnershipTransaction.

284. Call the trigger of the transition InitiateSale.

285. Add yet another state called OwnershipStable.

286. Add a transition from InOwnershipTransaction to OwnershipStable. Name the trigger CloseSale.

287. Add a transition from OwnershipStable to InOwnershipTransaction. Reuse the trigger InitiateSale on this transition.

288. Create an Entry Action in the state InOwnerShipTransaction.

  • Create a CarTransferOwnershipDocument and add it to the cars list of CarTransferOwnershipDocuments.
  • Also, assign the Seller of the new CarTransferOwnershipDocument to the current owner of the Car.

289. Add an association from CarTransferOwnershipDocument to Car. Call the single-end CurrentTransaction. Set the Car's end to not Navigable.

290. In the Entry Action, in the state InOwnerShipTransaction, assign the CurrentTransaction to the created document.

291. Go to Guard of CloseSale and check that the current transaction has a Buyer.

292. In the OwnershipStable, add an Entry action that removes the Car from Seller's CurrentlyOwnedCars and adds it to the Buyer's CurrentlyOwnedCars.

293. In the OwnershipStable, add an Entry action and add an update of the Seller's CarsOwnerUsedToOwn.

294. On the transition between BrandNew and InOwnerShipTransaction, add a guard that checks that there is a CarOwner.

295. On the InitiateSale trigger, add a ClassAction for the trigger.

296. On the CloseSale trigger, add a ClassAction for the trigger.

297. Refresh the AutoForms.

298. Save and test on the web.

  • Create a CarFactory.
  • Call it BWM in Munich.
  • Add a Car to this CarFactory.

299. Initiate the Sale and check that you get a CarTransferOwnershipDocument.

300. Assign a buyer in the CarTransferOwnershipDocument, then close the Sale. Check that ownership has switched.

301. Set the default representation of CarOwner to self.Name

Next Chapter

The_1000_steps_program_to_MDriven_Chapter_10

This page was edited 31 days ago on 04/12/2024. What links here