Thoughts on software multi-Version Upgrade

Source: Internet
Author: User

Recently, I have been thinking about the management of Web software upgrades. I have previously written them separately and updated them one by one. But later I found that the upgrade of the exaggerated version is troublesome. With the upgrade of the version,CodeMore and more code can't be reused, And I never think of a simple code method.

 
Using system; using system. web; namespace caicai. jingpin. UI. update {public class u_1_2: system. web. UI. page {protected void page_load (Object sender, eventargs e) {string action = request. querystring ["action"]; If (Action = "Update") {This. update () ;}} public void Update () {// Update fileProgramHttpcontext. Current. response. Write ("V1.0 upgraded to V2.0 successful! "); Httpcontext. Current. response. Write (" <br/> ");}}}
 using system; using system. web; namespace caicai. jingpin. UI. update {public class u_2_3: system. web. UI. page {protected void page_load (Object sender, eventargs e) {string action = request. querystring ["action"]; string version = request. querystring ["version"]; If (version = "1") {New u_1_2 (). update ();} If (Action = "Update") {This. update () ;}} public void Update () {// Update file program httpcontext. Current. response. Write ("V2.0 upgraded to V3.0 successfully! "); Httpcontext. Current. response. Write (" 
") ;}}
 using system; using system. web; namespace caicai. jingpin. UI. update {public class u_3_4: system. web. UI. page {protected void page_load (Object sender, eventargs e) {string action = request. querystring ["action"]; string version = request. querystring ["version"]; If (version = "1") {New u_1_2 (). update (); New u_2_3 (). update ();} If (version = "2") {New u_2_3 (). Update ();} If (Action = "Update") {This. update () ;}} public void Update () {// upgrade the file program httpcontext. current. response. write ("V3.0 is successfully upgraded to v4.0! "); Httpcontext. Current. response. Write (" 
") ;}}
Using system; using system. web; namespace caicai. jingpin. UI. update {public class u_4_5: system. web. UI. page {protected void page_load (Object sender, eventargs e) {string action = request. querystring ["action"]; string version = request. querystring ["version"]; If (version = "1") {New u_1_2 (). update (); New u_2_3 (). update (); New u_3_4 (). update ();} If (version = "2") {New u_2_3 (). update (); New u_3 _ 4 (). update () ;}if (version = "3") {New u_3_4 (). update ();} If (Action = "Update") {This. update () ;}} public void Update () {// upgrade the file program httpcontext. current. response. write ("v4.0 is successfully upgraded to V5.0! "); Httpcontext. Current. response. Write (" <br/> ");}}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.