top of page
Search

Digital transformation hard, maybe!

You've hit a common and frustrating scenario: a complex legacy application with no documentation, multiple databases, and the need to build a modern front end. Directly trying to reverse-engineer everything through the existing code and then replicate the conditional logic in React is indeed a recipe for pain and missed pieces.


Your instinct to look at the screen and then query the databases directly is a very sound and practical approach in this situation. Here's why and how you can expand on that:


Why This Approach is Better:

  • Focus on Functionality, Not Implementation: You're focusing on what data is displayed for a given user session, rather than how the legacy application retrieves and processes it. This bypasses the need to fully understand the intricate and undocumented logic within the legacy system.

  • Faster Path to Value: You can start building your React components and Spring Boot endpoints based on actual observed data, leading to quicker progress and demonstrable results.

  • Reduced Risk of Missing Logic: By observing the UI for various scenarios (different users, different data sets), you're more likely to capture the different data points and their variations that the legacy system presents.

  • Clearer Contract for the New System: You're essentially defining the data contract between your new front end and back end based on the existing application's output.

  • Iterative Approach: You can tackle the different sections of the benefit summary one by one, validating your new implementation against the legacy system as you go.

How to Implement This Approach:

  1. Identify Key Sections/Views: Break down the benefit summary screen into logical sections (e.g., demographics, copays, providers, claims, etc.).

  2. Establish Test Scenarios: For each section, create a set of diverse test scenarios. This should include:

    • Users with different benefit plans.

    • Users with varying levels of data (e.g., some have copays, some don't; some have multiple providers, some have none).

    • Edge cases or scenarios you suspect might trigger conditional logic in the UI.

  3. Observe the Legacy UI: For each test scenario, carefully examine the benefit summary screen and note down all the displayed data points and their labels. Take screenshots for reference.

  4. Direct Database Queries (with Caution):

    • Identify Potential Tables: Based on the displayed information, make educated guesses about which databases and tables might hold the relevant data. The labels on the screen can be a big clue.

    • Query with Specific User Context: Using the user's session information (if you can access it or simulate it), construct SQL queries to retrieve the data that should be displayed on the screen for that specific scenario.

    • Compare and Validate: Compare the data returned by your queries with what you see on the legacy UI. This helps you understand which tables and columns are involved in generating that part of the summary.

    • CAUTION: Be very careful when running queries against production databases. Ideally, work with a non-production environment. If you must query production, ensure you are only performing SELECTstatements and understand the potential impact of your queries on database performance.

  5. Develop Spring Boot Endpoints: Based on your findings, create Spring Boot REST endpoints that query the relevant databases and return the necessary data in a structured format (likely JSON).

  6. Build React Components: Design and build your React components to consume the data from your Spring Boot API and display it in a user-friendly way.

  7. Iterate and Refine: As you build each section, continuously test and compare the output of your new system with the legacy system for the same test scenarios. Refine your queries and React components as needed.

Addressing Conditional Logic:

While you're focusing on the data, you'll likely start to see patterns in when certain data points appear or disappear in the legacy UI. This is where you can begin to infer the conditional logic.

  • Observe Variations: Pay close attention to how the UI changes based on different user scenarios. For example, a "Copay" section might only appear if the user has had a visit requiring a copay.

  • Look for Common Data Points: Identify the underlying data that seems to trigger the display or hiding of certain elements. For instance, the presence of a "copay amount" in the database might determine whether the copay information is shown.

  • Implement Conditional Rendering in React: Once you understand the conditions, you can implement the corresponding conditional rendering logic in your React components.

Leveraging AI (Carefully):

While AI might not be able to magically decipher the entire legacy system without documentation, it can assist in specific areas:

  • Code Similarity Analysis: If you have snippets of code and want to find similar patterns across the codebase, AI tools can help.

  • SQL Query Generation/Explanation: If you have an idea of the tables involved, AI can help you draft SQL queries or explain complex existing queries (if you happen to find some).

  • Data Mapping Suggestions: Once you have some understanding of the data in different databases, AI might suggest potential relationships or mappings.

However, don't rely solely on AI for understanding the core business logic or undocumented conditional rendering. Your direct observation and database exploration will be far more reliable in this scenario.

In summary, your intuition to focus on the screen output and directly query the databases for specific scenarios is the most pragmatic and effective way to tackle this complex legacy system migration. It allows you to build your new application based on observable behavior rather than trying to fully reverse-engineer undocumented and intricate legacy code.

 
 
 

Recent Posts

See All

Comentários


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

©2020 by LearnTeachMaster DevOps. Proudly created with Wix.com

bottom of page