Cleaning up a complex WebForms project

I am currently working on a high traffic search site.

They have various changes that they want to implement over time, and have indicated that they ultimately want the site to be re-rendered in ASP.NET MVC.

The site is currently an ASP.NET WebForms project; however, the correct ASP.NET controls are rarely used. Instead, there are many server side tags, i.e. <% ...%>. The code in these tags will usually be a call to a static method in a static class, or a piece of C # code that generates HTML.

Many of the static methods generate HTML by adding text to a string builder and returning it as a string.

I understand the concept of the Helper method, but I don't like the idea of โ€‹โ€‹rendering HTML by concatenating it into a string variable. I think they would be better off using "Partials".

My concern is that this is a rather complex site, and I'm not sure if a complete rebuild of the site in ASP.NET MVC is a good idea.

Despite the poor structure, it is actually not that difficult to add new features that are requested. (Possibly because I had experience with complex code).

However, I think there is a risk that in the future, a requirement will be required in the future that will be very difficult to implement unless we do a complete cleanup of the code base.

I want to put this question there and see if anyone has a similar problem and how you dealt with it.

And what are your thoughts on reassembly as a 20% side project? Are there any disadvantages to this?

+2


source to share


2 answers


Wow, this is some kind of project.

Personally, I think any site written in ASP.Net needs to be completely redesigned in terms of the user interface. MVC does this in different ways.

On the other hand, your business logic should be fine, although I think as long as you have a separation of concerns and it is not UI related.

Data access should be in order and probably minimal contact is needed. But that again depends on how closely related your website is.

I think the best approach is to spend some time on how MVC does business and do a critical analysis of what it will take to transform, then start transforming all the layers above the UI into preperation.

Get your foundation in place and maybe even if possible already use the MVC framework. Again, only if you can and only if you are viable.



Doing this as a side project will work, I think, because you can take some of your libraries and start converting them to preperation for mvc conversion.

But remember that once you've reworked the project / layer that you (are) implementing, otherwise it runs the risk of being forgotten or making changes to another layer, which must then be coded into a new one, etc. know the pitfalls.

As far as the user interface is concerned, this will be great, especially if you are using a lot of asp controls. You want to spend a lot of time evaluating the user interface and making a list of the controls that you need to replace or write. Then you can see the pattern and achieve consistency.

If you have a lot of code in your code, you can start moving to another level, as this will help later on when creating controllers, etc. Then they can create a new layer and everything should be fine.

That's all I can think of out of my head. I will edit or comment on how I think about things.

Hope it helps.

+1


source


If I have this project and I was asked to redo it from scratch, I will not use MVC to render the UI, I will use Web API / OData to host all the backend and will use any good Front End to draw the UI, Angular will a very good option.

Having it as a side project is only good if the pace of change and new features in the old project is less than the breakthroughs made in the new project, you don't want to end up doing duplicate effort, and on some you will need to code old code.



Also, you need to consider any data migration if you have to change the storage setting.

0


source







All Articles