Implementation of Chain of Responsibility (CoR) Legislation in Western Australia
Chain of responsibility
12
Chain of responsibility
-
Upload
- -
Category
Technology
-
view
44 -
download
4
Transcript of Chain of responsibility
![Page 1: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/1.jpg)
Chain of responsibility
![Page 2: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/2.jpg)
Назначение• В разрабатываемой системе имеется группа
объектов (возможно создаваемых динамически), которые могут обрабатывать сообщения клиента по типу «обработай сам и/либо перешли другому»
FILEFoo.txt1024 Bytes
File Name handler
File Size handler
Accept() Accept()
![Page 3: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/3.jpg)
FILE
Foo.txt1024 Bytes
File Name filter
File Size filter
Accept() Accept()
![Page 4: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/4.jpg)
Применимость
• избежать жесткой привязки отправителя запроса к получателю, позволяя нескольким объектам обработать запрос
![Page 5: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/5.jpg)
Let’s code
![Page 6: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/6.jpg)
Делаем общий Handler
![Page 7: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/7.jpg)
UML
![Page 8: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/8.jpg)
Делаем реализации
![Page 9: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/9.jpg)
Делаем реализации
![Page 10: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/10.jpg)
UML
![Page 11: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/11.jpg)
Демка
![Page 12: Chain of responsibility](https://reader035.fdocuments.net/reader035/viewer/2022070603/587187961a28ab2c198b551f/html5/thumbnails/12.jpg)
Refs
• Github: bit.ly/resp-example• Presentation: bit.ly/resp-ppt