Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wizard for the Reverse Engineer Feature to improve developer UX #2626

Open
BillKrat opened this issue Nov 16, 2024 · 14 comments
Open

Wizard for the Reverse Engineer Feature to improve developer UX #2626

BillKrat opened this issue Nov 16, 2024 · 14 comments
Labels
enhancement New feature or request reveng

Comments

@BillKrat
Copy link

BillKrat commented Nov 16, 2024

This issue aims to improve the developer UX by implementing a wizard for the Reverse Engineer feature.

The POC is available at this fork / branch

Reverse Engineering Wizard

The following video demonstrates the wizard at work. Don't be distracted by its current design as XAML can be easily configured to look as required. At this point, it is a POC to demonstrate that a wizard can be used within the existing EFCorePowerTools project. The code for the wizard comes from the Microsoft WPF-Samples project [Windows/Wizard folder] which was slightly refactored for our purposes.

Where the patterns and design are subject to discussion and approval, the proposed path would be to use the Model-View-Presenter, View-Model [MPV-VM] pattern which is described below. However, unlike true MVP-VM, the view's code-behind logic may remain intact to minimize the refactor effort; with MVP-VM the view does not contain business logic.

mvpvm-demo.mp4

The sequence diagram below is a high level view of the wizard's primary classes. Note that the location of each
class within the solution is located below each timeline box (in gray), e.g., RegEngWizardhandler.cs is located
under the solution's Shared / Handlers / Wizard folder.

Figure 1

MVP-VM

The pattern suggested for the proposed work is the Model-View-Presenter, View-Model pattern. The current design lends
itself to this because it isn't a true MVVM pattern; unlike MVVM, the existing handler performs much of the business logic
invoking business logic within each of the view's code-behind classes, thus effectively overcoming some MVVM limitations. Traditional MVVM is more a "widget" pattern that mirrors the MVC pattern (adapted for WPF). With MVVM, the view and view model contain all of the logic and as such cannot be easily reused because of the tight coupling between the view, view model, and its logic layers.

Note: MVC evolved to the Model-View-Presenter pattern to overcome such limitations. MVP-VM (like MVP) is more of a framework pattern which will required for our use case.

Presenter (RevEngWizardHandler)

The presenter has primary responsibility for communicating with the business logic layer to populate the view model(s).
This pattern allows the views and view models to remain decoupled (lending to easier reuse and unit testing); Views
and view models do not access the business and/or data layers directly.

Model

Business and data access layers compose the model (in the MVC days it might have been referred to as application model). The presenter will use the business logic layer to populate the view models as required. Under MVP-VM, the business logic layer is the only component that communicate with the data access layer.

Views / View Models

The view reflects the data that is on its view model. Outside of the UI behavior logic, there is generally no business
logic within the view code-behind using MVP-VM. Under MVP-VM it is easy to reuse views and view-models because of this decoupling.

Note: for more indepth information on MVP-VM you can read my MSDN 2011 article MVP-VM Design Pattern for WPF

Proposed design

The below use case diagram reflects the relationships between the existing, and new, components.

Figure 2

High level UML for current design

These diagrams are not all inclusive, but will provide a high level view of applicable classes and primary processes invoked.

Page 1 - Choose Your Data Connection

Figure 3

Page 2 - Choose Your Database Objects

Figure 4

Page 3 - Choose Your Settings For Project

Figure 5
@ErikEJ
Copy link
Owner

ErikEJ commented Nov 17, 2024

Amazing - are you really willing to take on this huge task?

This will be a great UX improvement.

So we can basically add a new menu item: "Reverse Engineer Wizard (experimental)" and not break the exiting experience until we feel confident with the wizard.

Some additional thoughts/concerns:

  • There is also the call to the additional "Schema selection" and "Advanced settings" dialogs, I think we can keep both as is today?
  • Maybe we could replace the VS statusbar feedback during dialog transitions with a dialog step giving detailed progress?

@BillKrat
Copy link
Author

BillKrat commented Nov 18, 2024 via email

@ErikEJ
Copy link
Owner

ErikEJ commented Nov 18, 2024

What do you think about an additional wizard page (post processing) for navigation properties?

I say let's stick to the basics for now .. and I do not know of any current feature for navigation renaming other than T4.

@ErikEJ ErikEJ added enhancement New feature or request reveng labels Nov 19, 2024
@ErikEJ
Copy link
Owner

ErikEJ commented Nov 20, 2024

More thoughts:

  • The "Options" screen is quite high today, but I think we could move the help and rate buttons to a "Summary" screen, that also conatins the text currently written to the Output window (and therefore is not very visible)
  • At some point we should update the ReverseEngineerWizardLauncher class to launch the "new" UI experience

@BillKrat
Copy link
Author

FYI, my plan is to focus first on functionality; once all dialogs are refactored into the wizard (and working) I will circle back and comply with all logic/UI request. So please don’t take upcoming updates as ignoring request. Another objective will be to change “as little” code as possible, while moving the code forward with its new wizard.

@ErikEJ
Copy link
Owner

ErikEJ commented Nov 20, 2024

@BillKrat sounds good, let's start simple!

@BillKrat
Copy link
Author

BillKrat commented Nov 21, 2024

@ErikEJ I created a project to manage the wizard work and assigned you as admin EFCorePowerTools Reverse Engineer Wizard; please feel free to update backlog as needed. Note: I created tasked, estimated, and provided a projected roadmap for work.

@ErikEJ
Copy link
Owner

ErikEJ commented Nov 21, 2024

@BillKrat I added some updates to the project

@ErikEJ ErikEJ pinned this issue Nov 21, 2024
@BillKrat
Copy link
Author

BillKrat commented Dec 1, 2024

@ErikEJ reference video of wizard at work. There are two remaining development tasks in the project .

  1. Potential summary wizard page - could use an assist on this one. Perhaps some mockups or more detailed information on what this page should contain. Note: the links on the final dialog page (Help and *Rate won't work until I move them).
  2. "Launch new Wizard from Add New Item dialog" - is this the new experimental launch item? (ref video)

For this phase of development the goal was to touch as little code as possible. In the future should you want to upgrade the EfCorePowerTools and are interested we can revisit a pattern more suitable for wizard support (using actual BLL and DAL).

I'll be adding testing tasks. This part will slow me down as I'll have to ramp up to application outside of the reverse engineer feature, e.g., untouched dialogs which should work. Since I touched very little code in the handler the scope of testing should be minimal. If you do a code compare between the current and new handlers you'll see the only changes that impact actual code (short of menu updates). I worked hard to ensure backwards compatibility.

image

@BillKrat
Copy link
Author

BillKrat commented Dec 1, 2024

@ErikEJ
Note: when the feature is no longer experimental the RevEngWizardHandler.cs will no longer exist; the code in ReverseEngineerHandler will be updated. Also, I added Rick Strahl's WPF Statusbar for the wizard - moving forward this can be leveraged to provide more enhanced statuses.

@ErikEJ
Copy link
Owner

ErikEJ commented Dec 1, 2024

@BillKrat Awsome!

Potential summary wizard page:

A page with a read only text box labelled "Summary" - contains the output from the Extensions output window, possibly with warning: and error: replaced with icons / emojis

Note: the links on the final dialog page (Help and *Rate won't work until I move them).

Where will they be moved to?

"Launch new Wizard from Add New Item dialog"

  • yes, but much later!

@BillKrat
Copy link
Author

BillKrat commented Dec 2, 2024

@ErikEJ

Where will they be moved to?

On this link it was suggested they be moved to the new summary page. I'll be starting the new summary page early this week. I'll go with the guidance you provided [and any new ideas that you may have].

@ErikEJ
Copy link
Owner

ErikEJ commented Dec 2, 2024

@BillKrat

it was suggested they be moved to the new summary page.

Ah! Thinking more about it and viewing your video, I think the help button / link should remain on the advanced options page, and the Rate link/button could be moved to the summary page.

@ErikEJ
Copy link
Owner

ErikEJ commented Dec 15, 2024

@BillKrat Just checking in if you are blocked waiting for any input from me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reveng
Projects
None yet
Development

No branches or pull requests

2 participants