Decomposing the code - AWS Prescriptive Guidance

Decomposing the code

Prerequisites

This demonstration uses the CardDemo mainframe credit card management application. Before you start the decomposition, follow these steps:

  1. Input the application code into AWS Transform.

  2. Complete the analysis phase.

  3. Generate technical documentation and review documentation results.

For instructions, see steps 1–8 in the Transformation of mainframe applications section of the AWS Transform documentation.

For the following steps, use these options on the AWS Transform console:

  • Use Create domain to create domains by selecting components and identifying them as seeds. As discussed in the previous section, seeds are key elements that help identify and group related components into domains.

  • Use the Actions menu to create domains, edit domains, remove domains, import domain files, download domain files, configure decomposition, and update dependencies files.

Step 1: Identify seeds

In this step, you create domains based on the decomposition strategy you've decided to use. The following example assumes that you're using the strangler fig pattern. The seeds for decomposing the CardDemo application are based on transaction naming standards. The application is decomposed into several online domains that manage different functions in the application, and the batch processing is assigned to a separate domain. The seeds used for different domains are as follows.

  • Domain 1: Account Management

    • CAVW – Account View

    • CAUP – Account Update

  • Domain 2: Card Management

    • CCLI – CC List

    • CCDL – CC View

    • CCUP – CC Update

  • Domain 3: Transactions Management

    • CT00 – Transaction List

    • CT01 – Transaction View

    • CT02 – Transaction Add

    • CR00 – Transaction Reports

  • Domain 4: Bill Pay (Pay Balance)

    • CB00 – Bill Payment

  • Domain 5: Administration Menu

    • CA00 – Administration Menu

    • CU00 – List User

    • CU01 – Add User

    • CU02 – Update User

    • CU03 – Delete User

  • Domain 6: CardDemo Batch Processing

    • *.JCL – All JCL files that handle maintenance

Step 2: Create domains

Choose the Create domain command to create the first domain (Account Management).

Provide a unique name and a meaningful description for the domain. The list of files can be ordered by name, type, seeds (if they were identified previously), or cyclomatic complexity.

For the Account Management domain, you can identify seeds based on transactions. Select files that have a type of TRANSACTION, and select the transactions CAUP and CAVW, as shown in the following screen illustration. Choose Mark as seed to identify these elements as seeds for the Account Management domain. Choose Create to create the domain.

Identifying seeds for a domain in mainframe decomposition.

Repeat this process for the five remaining domains identified in step 1, by choosing Create domain from the Actions menu. The next screen provides a tabular view of the domains, the number of files you selected for each domain, and the number of seeds, as shown in the following illustration.

Tabular view of a domain in mainframe decomposition.

Step 3: Configure decomposition and enable seed augmentation

After you define your domains and select seeds for decomposition, choose Configure decomposition. The Domain configuration tab, as shown in the next illustration, displays the threshold configuration that can be set at the domain level, to provide flexible domain sizes across different parts of the project.

Domain size thresholds in mainframe decomposition.

Step 4: Make additional changes before decomposition

You can export the domains as a JSON or CSV file, modify it, and upload it back to AWS Transform. The import/export option provides the flexibility for you to further define and modify domains. In addition, you can download, modify, and upload the dependencies file and then choose Decompose.

Step 5: Decompose into domains

When you choose Decompose, the View decomposition results screen provides the results of the decomposition in table view, as shown in the following illustration. It displays the domain name, description, file percent (percentage of number of files compared with total files), number of files, number of seeds, and lines of code for each domain.

Tabular view of decomposition results in mainframe decomposition.

When you choose a domain, the screen also displays the details of all files that have been identified as part of that domain, as shown in the following illustration.

Drilling down to see domain-specific information in mainframe decomposition.

You can also choose the graph view to see graphical dependencies or domains at the domain level.

Based on the results of the decomposition, you can make additional changes to the domains and seeds, and decompose the domain again. You can use the dependencies file to download dependencies from the AWS Transform analysis, update them, and upload the file again. AWS Transform will display the dependencies based on the updated information.

When you are satisfied with the decomposition analysis, you can send this information to AWS Transform to complete the domain-based decomposition and create initial wave plans. After decomposition is complete, the dashboard, shown in the following screen illustration, displays a summary of decomposition results. It shows the number of files by domain along with the percentage of files in each domain.

AWS Transform dashboard with decomposition results.