SlideShare a Scribd company logo
i | P a g e
PROCESSOR REFACTOR
A Course Correction
D. Harrison
December 2023
© 2023, David Harrison, All Rights Reserved
Table of
CONTENTS
Introduction.............................................................................1
First Look ................................................................................3
Testing…Testing….....................................................................6
OTA_PingRQ ............................................................................7
Coming Next.......................................................................... 12
1 | P a g e
INTRODUCTION
Since early Q2 2023, I have been refactoring the processor, an integral part of
the Schema Studio application.
In previous work, I focused on the lower-level XSD entities directly, a bottom-
up development process.
In the event, when approaching the entities at the higher levels, for example,
messages, the architecture of the processor was simply incompatible with the
deeply recursive forms involved. This nested structure is demonstrated in the
message definition of OTA_AirBookRQ, shown below:
2
This basic incompatibility between the former code structure and what was
needed to fluently handle deep recursive structures led to a complete re-think
of how the processing needed to be performed. In this new approach, the
extensibility parts handle all the processing steps once the Structure Element
Repository is built in a first pass.
In developing this new top-down approach, the initial example used is that of
the message OTA_PingRQ (shown below), arguably the simplest message in the
Open Travel set.
3
First Look
As a first look at the generated code from the processor which embodies this
new approach, below is shown a fragment of the code generated for the
AttributeGroup OTA_PayloadStdAttributes (the definition of which is shown in
the figure above) which is a key part of the definition of OTA_PingRQ:
4
For the most part, the Attribute entities involved are reasonably
straightforward, e.g. EchoToken. However, those named Target and
TransactionStatusCode involve a SimpleType restriction expressed as an
enumeration. In such cases, the processor generates a generic Attribute
creation statement, where the type parameter is the internal, generated,
enumeration, e.g. Target_Enum.
5
These generated, internal, enumerations, Target_Enum and
TransactionStatusCode_Enum, are shown below:
6
Testing…Testing…
The types generated need to be validated via unit testing and the test for
OTA_PayloadStdAttributes is shown below:
7
OTA_PINGRQ
The generation of the OTA_PingRQ involves two phases. The first phase deals
with the basic class structure and characteristics, and the second will cover the
Serialization/Deserialization aspects.
A fragment of the generated class appropriate to the first phase is shown in the
following figures:
8
9
10
As in the OTA_PayloadStdAttributes case we need to ensure that our class
passes an appropriate set of tests. These tests are as shown below:
11
12
COMING NEXT
The target in this first phase of refactoring the processor that runs inside
Schema Studio is to generate a strong type class for OTA_PingRQ and this basic
form is shown in the previous section. The vital Serialization/Deserialization part
remains to be done, the documentation for which will be covered in a
subsequent article.
The next candidate will be the rather more complex OTA_CancelRQ, a definition
fragment of which is shown below:
In order the test a generated strong type for OTA_CancelRQ, we will need to
have available the following validated types:
Type Name Comment
UniqueID_Type ComplexType
OTA_CommonTypes.xsd
VerificationType ComplexType
OTA_CommonTypes.xsd
LocationType ComplexType
OTA_CommonTypes.xsd
PersonNameType ComplexType
OTA_CommonTypes.xsd
OTA_CodeType SimpleType
OTA_SimpleTypes.xsd
CancelRuleType ComplexType
OTA_CommonTypes.xsd
FreeTextType ComplexType
OTA_CommonTypes.xsd
13
ContactPersonType ComplexType
OTA_CommonTypes.xsd
TPA_Extensions ComplexType
OTA_CommonTypes.xsd
OTA_PayloadStdAttributes -
ReqRespVersion AttributeGroup
OTA_CommonTypes.xsd
TransactionActionType SimpleType
OTA_SimpleTypes.xsd
StringLength1to64 SimpleType
OTA_SimpleTypes.xsd
NonNegativeInteger XSD Primitive
StringLength1to32 SimpleType
OTA_SimpleTypes.xsd
StringLength0to64 SimpleType
OTA_SimpleTypes.xsd
It should be noted that strong type classes, such as OTA_PingRQ and
OTA_CancelRQ, involve serialization/deserialization to XML methods as well as
the following methods and operators: Clone() and ToString() implementations.
Method/Operator Comment
Copy Constructor Instantiate a type from another instance
GetHashCode() Gets a type-related Hash code
Clone() A type-specific clone method
Operator == A type-specific comparison operator
Operator != A type-specific comparison operator
Equals() A type-specific equality method (used by the
comparison operators)
ToString() Provides a type-specific conversion to a string
form
These types also have an appropriate base class which offers properties and
methods common to all classes of a given type (e.g. ComplexType,
AttributeGroup, Element etc).

More Related Content

Similar to Processor Refactoring.pdf

B035-2447-220K.pdf
B035-2447-220K.pdfB035-2447-220K.pdf
B035-2447-220K.pdf
degido10
 
C++.Primer.5th.Edition very good _2013.pdf
C++.Primer.5th.Edition very good _2013.pdfC++.Primer.5th.Edition very good _2013.pdf
C++.Primer.5th.Edition very good _2013.pdf
arjurakibulhasanrrr7
 
How to analyzing sap critical authorizations
How to analyzing sap critical authorizationsHow to analyzing sap critical authorizations
How to analyzing sap critical authorizations
Anywhere Gondodza SAP.GRC.FI.B.COM.ACC.HONS (MSU)
 
Generation_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdfGeneration_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdf
David Harrison
 
Test data article
Test data articleTest data article
Test data article
David Harrison
 
SDTMIG_v3.3_FINAL.pdf
SDTMIG_v3.3_FINAL.pdfSDTMIG_v3.3_FINAL.pdf
SDTMIG_v3.3_FINAL.pdf
ssusera19791
 
Documentation - MyGlWindowPlot
Documentation - MyGlWindowPlotDocumentation - MyGlWindowPlot
Documentation - MyGlWindowPlot
Michel Alves
 
CA Service Desk Administrator Guide with Examples
CA Service Desk Administrator Guide with ExamplesCA Service Desk Administrator Guide with Examples
CA Service Desk Administrator Guide with Examples
Arshad Havaldar
 
C++ annotations version
C++ annotations versionC++ annotations version
C++ annotations version
PL Sharma
 
estaditca 2
estaditca 2estaditca 2
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfGeneration_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdf
David Harrison
 
Role Based Access Control - Overview
Role Based Access Control - OverviewRole Based Access Control - Overview
Role Based Access Control - Overview
Hitachi ID Systems, Inc.
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
Arulalan T
 
GNU Gatekeeper 5.11
GNU Gatekeeper 5.11GNU Gatekeeper 5.11
GNU Gatekeeper 5.11
J W
 
Generation_XSD_Article.docx
Generation_XSD_Article.docxGeneration_XSD_Article.docx
Generation_XSD_Article.docx
David Harrison
 
PagesToGo.pdf
PagesToGo.pdfPagesToGo.pdf
PagesToGo.pdf
David Harrison
 
Manual
ManualManual
21.1 personalization changing-the_field_name_part_21.1
21.1 personalization changing-the_field_name_part_21.121.1 personalization changing-the_field_name_part_21.1
21.1 personalization changing-the_field_name_part_21.1
Oracle HRMS Functional Consultant
 
software-testing-framework 3
software-testing-framework 3software-testing-framework 3
software-testing-framework 3
pradeepcutz
 
Software Requirement Specification Master Template
Software Requirement Specification Master TemplateSoftware Requirement Specification Master Template
Software Requirement Specification Master Template
Wayne Chen
 

Similar to Processor Refactoring.pdf (20)

B035-2447-220K.pdf
B035-2447-220K.pdfB035-2447-220K.pdf
B035-2447-220K.pdf
 
C++.Primer.5th.Edition very good _2013.pdf
C++.Primer.5th.Edition very good _2013.pdfC++.Primer.5th.Edition very good _2013.pdf
C++.Primer.5th.Edition very good _2013.pdf
 
How to analyzing sap critical authorizations
How to analyzing sap critical authorizationsHow to analyzing sap critical authorizations
How to analyzing sap critical authorizations
 
Generation_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdfGeneration_XSD_Article - Part 4.pdf
Generation_XSD_Article - Part 4.pdf
 
Test data article
Test data articleTest data article
Test data article
 
SDTMIG_v3.3_FINAL.pdf
SDTMIG_v3.3_FINAL.pdfSDTMIG_v3.3_FINAL.pdf
SDTMIG_v3.3_FINAL.pdf
 
Documentation - MyGlWindowPlot
Documentation - MyGlWindowPlotDocumentation - MyGlWindowPlot
Documentation - MyGlWindowPlot
 
CA Service Desk Administrator Guide with Examples
CA Service Desk Administrator Guide with ExamplesCA Service Desk Administrator Guide with Examples
CA Service Desk Administrator Guide with Examples
 
C++ annotations version
C++ annotations versionC++ annotations version
C++ annotations version
 
estaditca 2
estaditca 2estaditca 2
estaditca 2
 
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdfGeneration_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 3.pdf
 
Role Based Access Control - Overview
Role Based Access Control - OverviewRole Based Access Control - Overview
Role Based Access Control - Overview
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
GNU Gatekeeper 5.11
GNU Gatekeeper 5.11GNU Gatekeeper 5.11
GNU Gatekeeper 5.11
 
Generation_XSD_Article.docx
Generation_XSD_Article.docxGeneration_XSD_Article.docx
Generation_XSD_Article.docx
 
PagesToGo.pdf
PagesToGo.pdfPagesToGo.pdf
PagesToGo.pdf
 
Manual
ManualManual
Manual
 
21.1 personalization changing-the_field_name_part_21.1
21.1 personalization changing-the_field_name_part_21.121.1 personalization changing-the_field_name_part_21.1
21.1 personalization changing-the_field_name_part_21.1
 
software-testing-framework 3
software-testing-framework 3software-testing-framework 3
software-testing-framework 3
 
Software Requirement Specification Master Template
Software Requirement Specification Master TemplateSoftware Requirement Specification Master Template
Software Requirement Specification Master Template
 

More from David Harrison

PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
David Harrison
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
David Harrison
 
Generation_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdfGeneration_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdf
David Harrison
 
Babble article - Test Automation & Text Translation
Babble article - Test Automation & Text TranslationBabble article - Test Automation & Text Translation
Babble article - Test Automation & Text Translation
David Harrison
 
Bdd Show and Tell
Bdd Show and TellBdd Show and Tell
Bdd Show and Tell
David Harrison
 
UI Testing Pattern
UI Testing PatternUI Testing Pattern
UI Testing Pattern
David Harrison
 
Soap ui automation
Soap ui automationSoap ui automation
Soap ui automation
David Harrison
 
High sierra part 1
High sierra part 1High sierra part 1
High sierra part 1
David Harrison
 
Selenium Testing @ Agile Speed
Selenium Testing @ Agile SpeedSelenium Testing @ Agile Speed
Selenium Testing @ Agile Speed
David Harrison
 
Workflow Test Automation
Workflow Test AutomationWorkflow Test Automation
Workflow Test Automation
David Harrison
 
Et sensus agile documentation
Et sensus   agile documentationEt sensus   agile documentation
Et sensus agile documentation
David Harrison
 
Web Test Automation
Web Test AutomationWeb Test Automation
Web Test Automation
David Harrison
 

More from David Harrison (12)

PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
 
PhoenixRisingArticle.pdf
PhoenixRisingArticle.pdfPhoenixRisingArticle.pdf
PhoenixRisingArticle.pdf
 
Generation_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdfGeneration_XSD_Article - Part 2.pdf
Generation_XSD_Article - Part 2.pdf
 
Babble article - Test Automation & Text Translation
Babble article - Test Automation & Text TranslationBabble article - Test Automation & Text Translation
Babble article - Test Automation & Text Translation
 
Bdd Show and Tell
Bdd Show and TellBdd Show and Tell
Bdd Show and Tell
 
UI Testing Pattern
UI Testing PatternUI Testing Pattern
UI Testing Pattern
 
Soap ui automation
Soap ui automationSoap ui automation
Soap ui automation
 
High sierra part 1
High sierra part 1High sierra part 1
High sierra part 1
 
Selenium Testing @ Agile Speed
Selenium Testing @ Agile SpeedSelenium Testing @ Agile Speed
Selenium Testing @ Agile Speed
 
Workflow Test Automation
Workflow Test AutomationWorkflow Test Automation
Workflow Test Automation
 
Et sensus agile documentation
Et sensus   agile documentationEt sensus   agile documentation
Et sensus agile documentation
 
Web Test Automation
Web Test AutomationWeb Test Automation
Web Test Automation
 

Recently uploaded

一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 

Recently uploaded (20)

一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 

Processor Refactoring.pdf

  • 1. i | P a g e PROCESSOR REFACTOR A Course Correction D. Harrison December 2023 © 2023, David Harrison, All Rights Reserved
  • 2. Table of CONTENTS Introduction.............................................................................1 First Look ................................................................................3 Testing…Testing….....................................................................6 OTA_PingRQ ............................................................................7 Coming Next.......................................................................... 12
  • 3. 1 | P a g e INTRODUCTION Since early Q2 2023, I have been refactoring the processor, an integral part of the Schema Studio application. In previous work, I focused on the lower-level XSD entities directly, a bottom- up development process. In the event, when approaching the entities at the higher levels, for example, messages, the architecture of the processor was simply incompatible with the deeply recursive forms involved. This nested structure is demonstrated in the message definition of OTA_AirBookRQ, shown below:
  • 4. 2 This basic incompatibility between the former code structure and what was needed to fluently handle deep recursive structures led to a complete re-think of how the processing needed to be performed. In this new approach, the extensibility parts handle all the processing steps once the Structure Element Repository is built in a first pass. In developing this new top-down approach, the initial example used is that of the message OTA_PingRQ (shown below), arguably the simplest message in the Open Travel set.
  • 5. 3 First Look As a first look at the generated code from the processor which embodies this new approach, below is shown a fragment of the code generated for the AttributeGroup OTA_PayloadStdAttributes (the definition of which is shown in the figure above) which is a key part of the definition of OTA_PingRQ:
  • 6. 4 For the most part, the Attribute entities involved are reasonably straightforward, e.g. EchoToken. However, those named Target and TransactionStatusCode involve a SimpleType restriction expressed as an enumeration. In such cases, the processor generates a generic Attribute creation statement, where the type parameter is the internal, generated, enumeration, e.g. Target_Enum.
  • 7. 5 These generated, internal, enumerations, Target_Enum and TransactionStatusCode_Enum, are shown below:
  • 8. 6 Testing…Testing… The types generated need to be validated via unit testing and the test for OTA_PayloadStdAttributes is shown below:
  • 9. 7 OTA_PINGRQ The generation of the OTA_PingRQ involves two phases. The first phase deals with the basic class structure and characteristics, and the second will cover the Serialization/Deserialization aspects. A fragment of the generated class appropriate to the first phase is shown in the following figures:
  • 10. 8
  • 11. 9
  • 12. 10 As in the OTA_PayloadStdAttributes case we need to ensure that our class passes an appropriate set of tests. These tests are as shown below:
  • 13. 11
  • 14. 12 COMING NEXT The target in this first phase of refactoring the processor that runs inside Schema Studio is to generate a strong type class for OTA_PingRQ and this basic form is shown in the previous section. The vital Serialization/Deserialization part remains to be done, the documentation for which will be covered in a subsequent article. The next candidate will be the rather more complex OTA_CancelRQ, a definition fragment of which is shown below: In order the test a generated strong type for OTA_CancelRQ, we will need to have available the following validated types: Type Name Comment UniqueID_Type ComplexType OTA_CommonTypes.xsd VerificationType ComplexType OTA_CommonTypes.xsd LocationType ComplexType OTA_CommonTypes.xsd PersonNameType ComplexType OTA_CommonTypes.xsd OTA_CodeType SimpleType OTA_SimpleTypes.xsd CancelRuleType ComplexType OTA_CommonTypes.xsd FreeTextType ComplexType OTA_CommonTypes.xsd
  • 15. 13 ContactPersonType ComplexType OTA_CommonTypes.xsd TPA_Extensions ComplexType OTA_CommonTypes.xsd OTA_PayloadStdAttributes - ReqRespVersion AttributeGroup OTA_CommonTypes.xsd TransactionActionType SimpleType OTA_SimpleTypes.xsd StringLength1to64 SimpleType OTA_SimpleTypes.xsd NonNegativeInteger XSD Primitive StringLength1to32 SimpleType OTA_SimpleTypes.xsd StringLength0to64 SimpleType OTA_SimpleTypes.xsd It should be noted that strong type classes, such as OTA_PingRQ and OTA_CancelRQ, involve serialization/deserialization to XML methods as well as the following methods and operators: Clone() and ToString() implementations. Method/Operator Comment Copy Constructor Instantiate a type from another instance GetHashCode() Gets a type-related Hash code Clone() A type-specific clone method Operator == A type-specific comparison operator Operator != A type-specific comparison operator Equals() A type-specific equality method (used by the comparison operators) ToString() Provides a type-specific conversion to a string form These types also have an appropriate base class which offers properties and methods common to all classes of a given type (e.g. ComplexType, AttributeGroup, Element etc).