如何恢复遗留系统的体系结构(PHP) [英] How to recover architecture of a legacy system (PHP)

查看:153
本文介绍了如何恢复遗留系统的体系结构(PHP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试恢复旧系统的体系结构,这对我来说是新事物.到目前为止,我已经阅读了许多研究论文,其中大多数研究人员都为此提出了框架和自动化工具,但我不知道该如何做.从这些框架或工具中选择最佳.所有研究对象都有一些通用步骤,例如逆向工程和正向工程. 有人可以帮忙吗? 开始遗留系统的恢复体系结构的基础阶段是什么? 基本步骤是什么? 有指导原则吗? 谢谢

I am trying to recover architecture of a legacy system.This is something new to me.Up to now I have read many research papers where most of the researchers have proposed frameworks and automated tools for this.But I have no idea how to choose the best from those frameworks or tools.All of the researched have some set of common steps like reverse engineering and forward engineering. Can someone help on this? What is the ground stage to begin the recovery architecture of a legacy system? What are the basic steps? Is there any guideline? Thanks

推荐答案

在转换旧版系统时,您必须牢记技术和团队.您必须进行的更改将进入应用程序的核心,并且如果开发团队无法进行更改,则迁移将会很漫长.

When converting a legacy system, you must keep in mind both the technology an the team. The changes you have to make will go to the core of the application, and if the dev team is not on board with the changes it will be a long slow migration.

重做旧系统的关键是依赖注入和服务位置.第一步是安装依赖项注入容器,并向该容器添加一个类(Logger始终是良好的第一服务).

The key to reworking a legacy system is dependency injection and service location. The first step is to install a dependency injection container and add a class to the container (the Logger is always a good first service).

下一步是添加服务定位器.构造函数注入是新建项目的最佳方法,但对于旧版应用程序,一开始是不可能的.使用服务定位器,您可以从任何地方访问进样容器,并在需要时进行服务解析.使用此功能,您可以浏览并使用记录器解析代码替换记录器创建代码.

Next step is to add a service locator. Constructor injection is the best approach for greenfield projects, but for legacy apps it's not possible at first. With the service locator you can access the injection container from anywhere, allowing service resolution where needed. With this in place you can sweep through and replace logger creation code with logger resolution code.

替换记录器是DI的工作原理的一个很好的例子,因此请向团队进行演示.确保团队彻底理解这些概念!其余过程在很大程度上取决于DI和服务位置.

The logger replacement is an excellent example of how DI works, so demo this to the team. Make sure the team understands these concepts thoroughly! The rest of the process heavily depends on DI and service location.

DI容器打破了旧系统中的紧密耦合,因此您可以将它们分开.开始寻找可以将应用程序分解成小块的接缝,从而可以引入单元测试.这也将为DDD迁移,微服务,EDA或您计划的任何目标体系结构奠定基础.

The DI container breaks the tight coupling in legacy systems so you can break things apart. Start looking for seams where you can break the app into smaller pieces, which allows you to introduce unit testing. This will also lay the groundwork for a DDD migration, microservices, EDA, or whatever target architecture you have planned.

这篇关于如何恢复遗留系统的体系结构(PHP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆