Hi.

Hi.
I'd like to refactor my desktop VCL application. I want to separate business logic from UI.

Best way to do that is use MVC, or MVVM pattern? And which library is the best to do this task in Delphi?

DelphiMVCFramework? Or maybe DSharp? Or else?

Comments

  1. I've used tiOPF (http://tiopf.sourceforge.net) to do just that for the last 16 years. Plus if you worry about the future of Delphi, tiOPF is fully supported under FPC (Free Pascal Compiler) too. It also includes tons of other useful classes, utility and frameworks.. Eg: MGM (Model-GUI-Meditor) for your UI, making any standard components "object aware" without the need for descendants etc.
    tiopf.sourceforge.net - tiOPF Home Page

    ReplyDelete
  2. From my experiment, properly separate UI and logic is mostly done by following principles like SOLID and abstraction via interfaces, not MVC or MVVM, which are just implementation paths, and could end-up in perfectly unmaintainable code, too. There is some well identified methodology to work with legacy code - see
    e.g. slideshare.net - Ekon20 mORMot Legacy Code Technical Debt Delphi Conference

    ReplyDelete
  3. Before I do anything with legacy code, I start by writing some unit tests to make sure I can prove the current behaviour. Then as you refactor your code, you have constant proof that you broke nothing. Granted writing unit tests for messed up code is rather hard, but still vital none the less.

    ReplyDelete

Post a Comment