維護舊項目_為什么您的舊版軟件難以維護-以及如何處理。

維護舊項目

Believe it or not, some organizations still rely on legacy software to carry out operations even though newer and more versatile options are available. We know that “old is gold”, but legacy applications cannot glitter forever. As such, these old and outdated programs have become hard to maintain.

信不信由你,即使有較新的和更通用的選項可用,一些組織仍然依靠舊版軟件來執行操作。 我們知道“古老就是黃金”,但是舊版應用程序無法永遠閃爍。 因此,這些舊的和過時的程序已變得難以維護。

Recently, the U.S. Government Accountability Office (GAO) gave a report that pointed out the most critical federal legacy systems that need to be modernized. This is because they are based on antiquated programming languages, are prone to security loopholes, and are difficult to maintain.

最近,美國政府問責局(GAO)發表了一份報告 ,指出了需要現代化的最關鍵的聯邦遺留系統。 這是因為它們基于過時的編程語言,容易出現安全漏洞,并且難以維護。

Are you in the same shoes?

你穿同一雙鞋嗎?

In this article, I’m going to talk frankly about the challenges you'll face when maintaining legacy software applications, and how you can overcome them.

在本文中,我將坦誠地談論維護舊版軟件應用程序時將面臨的挑戰,以及如何克服這些挑戰。

舊版系統效率低下 (Legacy systems are inefficient)

Software maintenance is important – it helps enhance the efficiency of the product and narrows the margin for error. Without sufficient maintenance, an application can become inefficient and difficult to operate.

軟件維護很重要–它有助于提高產品效率并縮小錯誤余地。 沒有足夠的維護,應用程序可能會變得效率低下且難以操作。

First of all, maintaining a legacy system can be difficult because the code used is old when compared to the code used in any modern software. Old code usually tends to be bulky, lengthy, and incompatible with most modern systems.

首先,維護遺留系統可能很困難,因為與任何現代軟件中使用的代碼相比,所使用的代碼是舊的。 舊代碼通常趨于龐大,冗長,并且與大多數現代系統不兼容。

For example, JavaScript arrow functions, which were introduced in ES6 in 2015, offer developers a way to write shorter and cleaner function syntax, which is easier to maintain.

例如,2015年ES6中引入JavaScript箭頭函數為開發人員提供了一種編寫更簡短的函數語法的方法,該語法更易于維護。

let total = (x, y) => x + y;/* This arrow function is a shorter form of:
let total = function(x, y) {return x + y;
};
*/console.log(total(5, 2) ); 
// 7

維護費用高 (High maintenance costs)

Another challenge facing most legacy systems is the high cost of maintenance, which may be out of reach for most enterprises.

大多數傳統系統面臨的另一個挑戰是維護成本高昂,這對于大多數企業而言可能是無法承受的。

For example, according to the GAO report mentioned above, the U.S. government planned to spend more than $90 billion in 2019 on IT services, most of which went towards maintaining aging systems.

例如,根據上述GAO報告,美國政府計劃在2019年在IT服務上花費超過900億美元,其中大部分用于維護老化的系統。

Furthermore, as technology is evolving, compliance is becoming a major issue for the protection of consumer-facing applications. Achieving compliance with legacy systems is time-consuming and expensive. It will not happen as quickly compared to new applications who are often compliant by default. It also requires a lot of testing to ensure a legacy infrastructure is compliant with the given regulations.

此外,隨著技術的發展,合規性已成為保護面向消費者的應用程序的主要問題。 實現與舊系統的合規性既耗時又昂貴。 與通常默認情況下兼容的新應用程序相比,它不會那么快發生。 它還需要進行大量測試,以確保舊式基礎結構符合給定的法規。

The cost of maintaining a legacy system often increases with time, as it slowly becomes obsolete due to technological enhancements. Also, modification of an existing system is a risky venture, which requires a lot of time and resources.

維護遺留系統的成本通常會隨著時間的流逝而增加,因為隨著技術的增強,它逐漸變得過時。 另外,修改現有系統是冒險的,需要大量時間和資源。

缺乏足夠的技能 (Lack of sufficient skill sets)

For legacy software to be maintained, you need a developer conversant with its operations. However, most developers are future-proofing their applications with new technologies. So, getting someone who can work with an old system can be a challenge.

為了維護舊版軟件,您需要一個熟悉其操作的開發人員。 但是,大多數開發人員正在使用新技術對應用程序進行過時的驗證。 因此,找到可以使用舊系統的人可能是一個挑戰。

In some cases, you might need to re-train developers on how the legacy system works, which increases a company’s operating costs.

在某些情況下,您可能需要對開發人員進行有關舊系統如何工作的培訓,這會增加公司的運營成本。

Furthermore, managing and controlling changes occurring in the software can be difficult. A lot of time and effort is required to keep the systems operational, which is expensive and time-consuming.

此外,管理和控制軟件中發生的更改可能很困難。 要使系統保持運行需要大量時間和精力,這既昂貴又費時。

與其他IT解決方案不兼容 (Incompatibility with other IT solutions)

Currently, there are modern tools that can be used to enable fast and smooth maintenance of software. However, most legacy IT infrastructure is incompatible with such solutions, which complicates their maintenance.

當前,有現代工具可用于實現軟件的快速平穩維護。 但是,大多數舊版IT基礎架構與此類解決方案不兼容,這使它們的維護復雜化。

If the features in a legacy system are not compatible with those of new IT solutions, developers may find it difficult to integrate them into their environments.

如果舊系統中的功能與新IT解決方案的功能不兼容,則開發人員可能會發現很難將其集成到他們的環境中。

The difficulty of introducing new features to legacy systems also adds to the challenges in their maintenance. Since most legacy systems break easily, trying to restructure and make them more maintainable may not work as expected.

向舊系統中引入新功能的困難也增加了其維護方面的挑戰。 由于大多數遺留系統很容易損壞,因此嘗試進行重組并使其更易于維護可能無法按預期進行。

應對挑戰 (Solutions to the challenges)

To compete favorably in today’s dynamic IT landscape, legacy technologies need modernization. Updated legacy applications lead to more user productivity, reduced maintenance costs, and more helpful experiences.

為了在當今瞬息萬變的IT環境中贏得有利的競爭,傳統技術需要進行現代化。 更新的舊版應用程序可提高用戶的工作效率,降低維護成本,并提供更多有用的體驗。

According to recent research by Avanade, modernizing IT systems can lead to a revenue growth of about 14%. Therefore, choosing different software modernization options could lead to significant benefits to your business.

根據Avanade的最新研究,現代化的IT系統可以帶來大約14%的收入增長。 因此,選擇不同的軟件現代化選項可能會為您的業務帶來重大利益。

It’s important to note that software should not be declared obsolete just because it’s old. Some of the ‘old’ software may still contain rich features, which can be useful to the optimal functioning of an application.

重要的是要注意,不應僅因為軟件過舊就宣布其過時。 某些“舊”軟件可能仍包含豐富的功能,這些功能可能有助于優化應用程序的功能。

Therefore, to overcome the challenges of maintaining aging software, developers can opt to refactor the source code of the system. This way, they can use clean and modern code that is reusable and easy to debug.

因此,為了克服維護老化軟件的挑戰,開發人員可以選擇重構系統的源代碼。 這樣,他們可以使用可重復使用且易于調試的干凈現代代碼。

In refactoring, you alter your software system to enhance its internal structure. But you don't interfere with the external behavior of the code. This way, the features of the software are optimized due to the code's internal improvements.

在重構中,您可以更改軟件系統以增強其內部結構。 但是您不會干擾代碼的外部行為。 這樣,由于代碼的內部改進,軟件的功能得以優化。

When refactoring legacy code, updates and modifications should be sufficiently tested to avoid breakages and poor functioning of the application. For example, regression tests can be done to ensure that everything is working as desired.

重構遺留代碼時,應充分測試更新和修改,以避免應用程序損壞和運行不佳。 例如,可以進行回歸測試以確保一切正常。

Additionally, where resources permit, developers can opt to rewrite the entire source code of the software, while employing modern programming approaches.

此外,在資源允許的情況下,開發人員可以選擇重寫軟件的整個源代碼,同時采用現代編程方法。

If you want to continue maintaining your legacy code without breaking it, you can use any of the following three methods:

如果要繼續維護舊代碼而不破壞它,則可以使用以下三種方法之一:

  1. Identifying change points in the code

    識別代碼中的變更點
  2. Isolating your code

    隔離您的代碼
  3. Wrapping the code

    包裝代碼

Let's talk about each of the methods.

讓我們談談每種方法。

識別代碼中的變更點 (Identify change points in the code)

As pointed out earlier, maintaining legacy code can be challenging. Sometimes the issue can be caused by a section that has been poorly programmed. Therefore, you can overcome this by identifying a location that can allow you to change the application's behavior without altering the source code.

如前所述,維護遺留代碼可能具有挑戰性。 有時,該問題可能是由于某個程序段的編程不正確引起的。 因此,您可以通過確定一個可以在不更改源代碼的情況下更改應用程序行為的位置來克服這一問題。

For example, let's say you have the following JavaScript code in a legacy application that connects to a database:

例如,假設您在連接數據庫的舊版應用程序中具有以下JavaScript代碼:

export class DataConnection {//some code hereconnector() {// some code to connect to database}
}

If you want to run some tests on the above code but the the connector() method is causing problems, you can identify where to modify the code behavior without affecting the source code.

如果要對上面的代碼運行一些測試,但是connector()方法引起了問題,則可以確定在不影響源代碼的情況下修改代碼行為的位置。

In this case, you can extend the DataConnection class and stop it from establishing a connection to an actual database:

在這種情況下,您可以擴展DataConnection類,并阻止其建立與實際數據庫的連接:

class FakeConnection extends DataConnection {connector() {// solve the issues of making calls to DBconsole.log("Establishing a connection")}
}

Consequently, after modifying the code behavior without affecting the source code, you can run tests on the code and maintain it without any problems.

因此,在修改代碼行為而不影響源代碼之后,您可以在代碼上運行測試并對其進行維護,而不會出現任何問題。

隔離您的代碼 (Isolate your code)

Another technique that can allow you to maintain your legacy code easily is to isolate and make any changes on a different environment. You just need to identify an insertion point where you can call that changed code from the existing legacy code.

可以使您輕松維護遺留代碼的另一種技術是隔離并在不同的環境上進行任何更改。 您只需要標識一個插入點,就可以從現有舊代碼中調用更改后的代碼。

Here is an example:

這是一個例子:

class BooksData {// some code hereaddBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

Let's say you want to optimize the books reference in the above legacy code, but addBooks() is giving you problems.

假設您想優化上述舊版代碼中的書籍參考,但是addBooks()給您帶來了問題。

So, you can isolate the code in another new method, like newBooks().

因此,您可以使用另一種新方法(例如newBooks())隔離代碼

Then you can run tests on this new method successfully because it is separate from the rest of the code. Afterwards, you can include a call to the new method in the existing, non-changed code. This way, there'll be minimal changes and minimal risks to the legacy code.

然后,您可以對該新方法成功運行測試,因為它與其余代碼是分開的。 之后,您可以在未更改的現有代碼中包含對新方法的調用。 這樣,對遺留代碼的更改最少,風險也最小。

Here it is:

這里是:

class BooksData {// some code herenewBooks(books) {// some smart and testable logic to optimize books}addBooks(books) {const newBooks = this.newBooks(books)for (let book of newBooks) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

包裝代碼 (Wrap the code)

If you want to make changes that should take place before or after the existing code, wrapping it can also be another solution.

如果要進行應在現有代碼之前或之后進行的更改,則將其包裝也可以是另一種解決方案。

You can achieve this by giving the old method you intend to wrap a new name, adding a new method with the same name and signature just like the old method, and calling the new method from the new method. Lastly, you should place the new logic before or after the previous method call.

您可以通過以下方式實現此目的:給您打算包裝新名稱的舊方法,添加一個與舊方法一樣具有相同名稱和簽名的新方法,然后從新方法中調用新方法。 最后,您應該將新邏輯放在上一個方法調用之前或之后。

With the new logic, you can run tests or make any changes you want – without affecting the source code.

使用新的邏輯,您可以運行測試或進行所需的任何更改-而不會影響源代碼。

For example, here is the code we used previously:

例如,這是我們之前使用的代碼:

class BooksData {// some code hereaddBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

Here is how to solve the problem through wrapping:

這是通過包裝解決問題的方法:

class BooksData {// some code hereaddBooks(books) {// some smart logic to get booksthis.addMoreNewBooks(moreBooks)}addMoreNewBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

結論 (Conclusion)

Although modernizing antique software is complicated, demanding, and risky, the results are usually worth the risk. Continuing to rely on legacy IT systems is the same as continuing to use the post office to send an urgent message, while an email could do the trick at the click of the button.

盡管對古董軟件進行現代化改造既復雜,苛刻又有風險,但通常值得承擔風險。 繼續依賴舊版IT系統與繼續使用郵局發送緊急消息的方法相同,而單擊按鈕則可以通過電子郵件來解決問題。

Furthermore, as a programmer, do you equip yourself with modern coding skills? Or, do you still rely on old approaches?

此外,作為一名程序員,您是否具備現代編碼技能? 或者,您仍然依靠舊方法嗎?

For example, in the exciting world of JavaScript programming, we’ve witnessed a surge of frameworks, like React and Angular, which are defining the future of the language. Spending some time learning about them could prevent you from falling into obsoleteness.

例如,在令人興奮JavaScript編程世界中,我們目睹了如React和Angular之類的框架的不斷涌現,它們定義了該語言的未來。 花一些時間了解它們可能會防止您過時。

Do you agree?

你同意嗎?

翻譯自: https://www.freecodecamp.org/news/legacy-software-maintenance-challenges/

維護舊項目

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390409.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390409.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390409.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

python--內置函數

內置函數現在python一共為我們提供了68個內置函數,講述過程:一、其他中的12個 (一)執行 字符串 類型代碼的執行 1 eval執行有意義的字符串 ,有返回值 print(eval(12))print(eval("print(美麗)")) #美麗 2 ex…

Nancy簡單實戰之NancyMusicStore(四):實現購物車

原文:Nancy簡單實戰之NancyMusicStore(四):實現購物車前言 上一篇,我們完成了商品的詳情和商品的管理,這一篇我們來完成最后的一個購物車功能。 購物車,不外乎這幾個功能:添加商品到購物車,刪除購物車中的商…

劍指 Offer 32 - I. 從上到下打印二叉樹

從上到下打印出二叉樹的每個節點&#xff0c;同一層的節點按照從左到右的順序打印。 例如: 給定二叉樹: [3,9,20,null,null,15,7], 3/ \9 20/ \15 7返回&#xff1a; [3,9,20,15,7] 提示&#xff1a; 節點總數 < 1000 解題思路 使用隊列實現層序遍歷 代碼 /*** …

數據庫表命名 單數復數_數據是還是數據是? “數據”一詞是單數還是復數?

數據庫表命名 單數復數Ill cut right to the chase: the word "data" is plural. Its the plural form of Latin word "datum." Many data. One datum.我將緊追其后&#xff1a;“數據”一詞是復數形式。 它是拉丁文“基準”的復數形式。 許多數據。 一個基…

《七步掌握業務分析》讀書筆記六

分析技術和呈現格式 詞匯表 強有力溝通的一個重要內容是一致地使用術語和慣用語。每次談話都涉及對術語的共同理解。 工作流圖&#xff08;也稱為流程圖、UNL活動圖和過程圖&#xff09; 工作流程把一個或多個業務過程的細節可視化地呈現出來&#xff0c;以澄清理解或提出過程改…

Mysql數據庫--語句整理/提升/進階/高級使用技巧

一、基礎 1、說明&#xff1a;創建數據庫CREATE DATABASE database-name 2、說明&#xff1a;刪除數據庫drop database dbname3、說明&#xff1a;備份sql server--- 創建 備份數據的 deviceUSE masterEXEC sp_addumpdevice disk, testBack, c:\mssql7backup\MyNwind_1.dat--- …

1104. 二叉樹尋路

在一棵無限的二叉樹上&#xff0c;每個節點都有兩個子節點&#xff0c;樹中的節點 逐行 依次按 “之” 字形進行標記。 如下圖所示&#xff0c;在奇數行&#xff08;即&#xff0c;第一行、第三行、第五行……&#xff09;中&#xff0c;按從左到右的順序進行標記&#xff1b;…

javascript 代碼_如何開始對JavaScript代碼進行單元測試

javascript 代碼We all know we should write unit tests. But, its hard to know where to start and how much time to devote to tests compared to actual implementation. So, where to start? And is it just about testing code or do unit tests have other benefits?…

個人作業——軟件工程實踐總結作業

一、請回望暑假時的第一次作業&#xff0c;你對于軟件工程課程的想象 1&#xff09;對比開篇博客你對課程目標和期待&#xff0c;“希望通過實踐鍛煉&#xff0c;增強計算機專業的能力和就業競爭力”&#xff0c;對比目前的所學所練所得&#xff0c;在哪些方面達到了你的期待和…

(轉)在阿里,我們如何管理代碼分支?

阿里妹導讀&#xff1a;代碼分支模式的選擇并沒有絕對的正確和錯誤之分&#xff0c;關鍵是與項目的規模和發布節奏相匹配。阿里協同研發平臺在經過眾多實踐歷練后&#xff0c;總結出了一套獨創的分支管理方法&#xff1a;AoneFlow&#xff0c;通過兼備靈活高效與簡單實用的流程…

WIN10系統 截圖或者某些程序時屏幕會自動放大怎么辦

右擊這個應用程序&#xff0c;兼容性&#xff0c;以兼容模式運行&#xff0c;同時勾選高DPI設置時禁止顯示縮放即可

css背景圖片添加url_CSS背景圖片–如何向您的Div添加圖片URL

css背景圖片添加urlSay you want to put an image or two on a webpage. One way is to use the background-image CSS property. 假設您要在網頁上放置一兩個圖片。 一種方法是使用background-image CSS屬性。 This property applies one or more background images to an el…

golang基礎01

1.環境變量&#xff1a;go env//代碼目錄和第三方庫文件set GOPATHC:\Users\hanxiaodong\go//go安裝目錄set GOROOTC:\Gopath里要配置&#xff1a;goroot/bin;和gopath/bin; gopath目錄下三個文件夾&#xff1a;pkg&#xff1a;編譯好的庫文件 .a 文件bin&#xff1a;可執行文件…

hugo 能做web開發嗎_如何自托管Hugo Web應用

hugo 能做web開發嗎After hosting with Netlify for a few years, I decided to head back to self hosting. There are a few reasons for that, but the main reasoning was that I had more control over how things worked. 在Netlify托管了幾年之后&#xff0c;我決定回到…

資源 | 深度學習課程入門與介紹

【1】Andrew NG Deep Learning.ai http://deeplearning.ai/網易云課堂&#xff08;中文字幕&#xff09;&#xff1a;http://mooc.study.163.com/smartSpec/detail/1001319001.htm推薦理由&#xff1a;Andrew Ng老師是講課的能手&#xff0c;很多人認識他是從Stanford的經典《機…

PostCSS 以及 cssnext語法

本文是對近兩天學習postcss的總結&#xff0c;在這里分享給大家。 如有錯誤&#xff0c;還請指正&#xff01; 什么是postcss postcss 一種對css編譯的工具&#xff0c;類似babel對js的處理&#xff0c;常見的功能如&#xff1a; 1 . 使用下一代css語法 2 . 自動補全瀏覽器前綴…

5187. 收集足夠蘋果的最小花園周長

給你一個用無限二維網格表示的花園&#xff0c;每一個 整數坐標處都有一棵蘋果樹。整數坐標 (i, j) 處的蘋果樹有 |i| |j| 個蘋果。 你將會買下正中心坐標是 (0, 0) 的一塊 正方形土地 &#xff0c;且每條邊都與兩條坐標軸之一平行。 給你一個整數 neededApples &#xff0c…

虛擬機 VMware Workstation12 安裝OS X 系統

Windows下虛擬機安裝Mac OS X —– VMware Workstation12安裝Mac OS X 10.11本文即將介紹WIN虛擬MAC的教程。完整詳細教程&#xff08;包含安裝中的一些問題&#xff09;【并且適用其他mac os x版本】Windows下 VM12虛擬機安裝OS X 10.11(詳細教程) 工具/原料 Mac OS X 10.11 鏡…

aws dynamodb_DynamoDB備忘單–您需要了解的有關2020 AWS認證開發人員助理認證的Amazon Dynamo DB的所有信息

aws dynamodbThe emergence of cloud services has changed the way we build web-applications. This in turn has changed the responsibilities of a Web Developer. 云服務的出現改變了我們構建Web應用程序的方式。 反過來&#xff0c;這改變了Web開發人員的職責。 We use…

北大CIO走進龍泉寺交流研討會圓滿舉行

緣起 2016年4月16日&#xff0c;北京大學信息化與信息管理研究中心秘書長姚樂博士與國家非物質文化遺產蔚縣剪紙傳承人周淑英女士一起在龍泉寺拜見了中國佛教協會會長、龍泉寺主持學誠法師。在拜見學誠法師時&#xff0c;姚樂博士與學誠法師聊到了“賢二機器僧”和人工智能。姚…