Updated.
Updated the question since it looks little ambiguous and not the answer i was looking for.
We have a huge .NET application running on MVC and angular. It has multiple projects under the main solution. .
We also have a replica of that application in Node.js for front end developers.
It looks something like this :
What happens is - Front end developers make changes in Node js solution (like js or .less files or controller) - make changes and move those changes to .Net solution which is the actual live project.
Off late - we have issues with developers working with two different solutions (Node and .NET) and keeping two copies of assets everywhere.
We ultimately decided to combine them and bring the whole Node.js application into ours .NET Solution as 6th project.
Something like this
Wondering if anyone has previously done so - adding a .NET application with existing Node.js application. If so any pros and cons to consider.
Some points to note - the Nodejs project and .Net project are completely independant of each other. The idea is to consolidate the applications so that We can either run the .net application or UI application from single solution.
Eventually, we will consolidate all the assets to just one project so that - we dont have to do duplicates.
Also, would appreciate any links where I can see how to start merging these two applications.
You definitely want to look at JavaScript Servcies. Building Single Page Applications on ASP.NET Core with JavaScriptServices.
Made for .NET Core, but you can run .NET Core on Full .NET Framework, which should make it easier to migrate to.
What I think you have is, say, a production version in .NET and a development environment in node.js for developers which prefer that.
At the company I work for, we use AngularJS for our front end and .NET/Entity Framework back end and it works pretty well.
I'm not sure if you are integrating some sort of JavaScript back end in with it or not. Assuming you are going to stick with a .NET backend and a JavaScript heavy frontend, it should be fairly easy.
That being said, nothing in this career is truly "easy". I would recommend using an AngularJS frontend as it has seemingly endless functionality.
Some minor suggestions if you choose that route is to check out John Papa's style guide. great reference for writing AngularJS. Make sure you have consistent naming, especially in Visual Studio as AngularJS can be a little moody.
I prefer to bind values to the view when working on AngularJS, e.g.
vm.title = "Data I want to bind"; in the view: <h1>{{vm.title}}</h1>
If that renders as {{vm.title}} instead of Data I want to bind you know something isn't working. I prefer catching it sooner rather than later.
Dependency Injection is another thing to be careful with, the style guide covers it as well. Basically if you minify your AngularJS files and the minifier removes the information required for DI, your project will break. I've been down that rabbit hole a few times.
If you aren't intending on using AngularJS then forget I said anything. I was just exercising my fingers. I hope that helps shed a little light on your decision.
Related
I have a working ASP.NET MVC 5 application and I need to run it under vNext. I assume there is no simple import possibility, so I'll need to do it manually. So basically I have a blank vNext project and a ready MVC5 project. I'll try to copy files and rewrite all dependencies in JSON config files. Maybe anyone tried to do something similar and can recommend best way and key points to achieve this task?
There are a few gotchas. One of them is the usage of notorious HttpContext.Current. It's basically gone in vNext. See if you have any usage for this inside your codebase.
As a general approach, in my personal opinion, do not ever try to upgrade an application in one go. There are so many new pieces that it's really hard to get a grasp of in a big giant app. Write small PoC samples to see each functionality in isolation. It will be easier to put them together when you know how each of them behave. I believe that's the best way to both learn the new system and understand the upgrade pains.
I have been following this approach to make it easy to move to the new system. It's a slower approach but it makes me learn the new system in a better way.
Also check out this discussion in ASP.NET Forums.
Looking for suggestions regarding an upcoming project that I am involved in which revolves around adding certain functionality to an existing ASP.NET application running on IIS 6.0 programmed in VB.NET.
To aid in future development the client wants the additional functionality to be as future proof as possible. Ideally I have said that I would like to push for a solution using ASP.NET MVC3, running off IIs 7.5 and .NET 4, written in C#. This solution would act as a seamless addition to the current web-portal appearing probably just as an extra tabbed page.
But they will be completely separate web-apps. Which is crucial.
The main problems I can foresee are firstly sharing session particulars between the asp.net web app and the new application. Particularly with regard to maintaining session state (and not having IIS timing out on one of the apps). Also, conjoining the two "apps" appears problematic in my head, although this may be far simpler than I fear.
I'm asking for suggestions for these two problems if anyone has any ideas please say!
So far I've come up with the following solutions be they terrible or not:
1) Embed the new functionality into the existing codebase (not a great option). This would mean losing any potential future upgrade-ability and also means not following better OO conventions by utilising the MVC framework.
2) Using an iFrame to link to the razor pages of a seperate MVC3 app (the one I'm favouring currently). Allows uses of all new technologies, however downside is sharing session data. Either through iFrame "attributes" (is this possible?) through persisting a session state to a db? (slow?) or even some kind of web service interaction between the applications to push/pull user/session data?
Any advice/suggestions greatly appreciated!
I agree with you that C# and MVC is the "way to go", but unfortunately mixing two applications together is going to give you a whole bunch of headaches, not least the different session IDs. You'd probably have to have a shared database table to map them together and, as you can probably imagine already this reeks of "Band-aid".
What are the ramifications in rebuilding what is existing, in to C#? Perhaps you could suggest a complete upgrade. The client themselves seem to extol the virtues of future-proofing and therefore this would be the way to go. And no, I wouldn't promote the use of a "code-converter", but it really shouldn't be that difficult.
The next thing to consider, I guess, is "future-proof". Is the client worried that VB.NET is going to disappear any-time soon or that it cannot handle anything in the future? I find that a very unlikely scenario, honestly.
I think I've waffled on a bit, but essentially combining two applications, one with old and one with new functionality will cause a headaches. This could be solved by migrating the old site to C#/MVC, and then adding the extra functionality. True, this may seem like a large commitment today - but further on down the road, it will pay dividends.
If the current site can be upgrade to .NET 4.0 there's no reason why you wouldn't extend the existing application.
There's nothing to stop you mixing MVC and web forms (indeed there are several articles on how to do just this). There's nothing to stop you mixing VB.NET and C# (or, so far as I'm aware, to stop you doing MVC in VB.NET).
You'd have to work very hard to convince me of the merits of using iFrames. Very hard. You might be able to persuade me of the merits of running two applications side by side - with the functionality split by folder - but to be honest I'd be much happier upgrading the existing site and then building from there.
We have a ten-year-old ASP application that we are considering planning an update for. We want to take advantage of the new technologies that ASP.NET has to offer, as well as the opportunity to fix some issues with the existing framework (the existing code-base is highly fragmented, nearly impossible to test, let alone debug, and the entire application appears to have been constructed according to the "Farmhouse Pattern".)
To that end, it seems that the time has come to rebuild this application. But, we are a small business, and we simply don't have the resources to either hire out the rebuild, nor to dedicate our small team of developers solely to the task of rebuilding (we've got other tasks on our plate, and can't concentrate on this one particular task for the length of time it would take to fully reconstruct the application).
What, then, are some useful strategies we can employ to help us convert this app, without having it consume all of our limited resources for the duration of the re-write?
Sounds like an interesting challenge. It's definitely not going to be easy, especially if you can't dedicate any resources to the project full time.
If you have a 10 year old application that is working, I would suggest not going for a complete re-write at all. I would start by sitting down and figuring out what you want your end product to be.
Is it going to be an ASP.NET MVC Web Application, an ASP.NET WebForms App, or something else? Once that decision is made, come up with a loose design for an architecture. If you do things correctly, you can build out bits and pieces of the business logic in .NET and utilize it from your Classic ASP code until you're ready to re-write the UI in .NET as well.
I agree with what Justin said; if you have a working application in place, you'll need a compelling reason (i.e., money) to justify the expense in rewriting the application for a new platform.
Although ASP classic and ASP.NET share a similar-looking syntax and some common coding conventions, they are very very different from each other. If you tried to simply copy-paste classic ASP code into an ASP.NET application, you might be able to get it to work, but you'd be missing out of a lot of the advantages of ASP.NET Web Forms or ASP.NET MVC (and their respective frameworks, of course).
You can, however, extend the functionality of the existing site with .NET code through web services or COM interop. We have a 10+ year old classic ASP web site and I've used both .NET web services (.asmx) and COM-callable .NET DLLs to enhance our existing application. In both cases, I wrote all of my new business logic in the .NET component and provided a chunky interface to work with the existing ASP page. That allowed my .NET code to be very easily testable and still use our existing (huge) investment in our classic ASP site.
The only approach that has worked for me is to carve of areas of functionality in small slices, and rewrite. "Converting" first, then refactoring seemed like a good idea a few times, but in the end just became horrible messes of code written in ASP.NET instead of ASP - and that added no value.
If you have a site that has distinct areas of functionality, carve one off and start with that (I chose "contact us"). Write it the way you think it should be written - that is, assume your new part is fitting into the end design of your well-written app. If you have to add "hacks" to interface with the old system, make sure they are isolated and commented.
When working on an update, think "can I carve of some of the functionality here into it's own bit?" - if so, convert it then update it. I found that if you insist on keeping the NEW app clean and allow yourself to add small hacks to the OLD app for communication, you get the best results.
This does mean you'll have two separate apps (two IIS web apps) for a while, and can make cookie/url and session management a bit hairy, as well as adding one more deployment concern. To combat this, make sure that you minimize state in your web app (always a good idea anyway), and share state through something other than Session.
If you do this a piece at a time, make the pieces small enough, and have a good design up-front, this works well - at least in my experience, it's the way that works best. Note that my experience may not match reality.
I've started working on an existing, large ASP.NET project and I'd love to get some feedback on better ways to organize the project as a whole. This question was somewhat related but doesn't really have enough specific details to help an ASP.NET newbie like me.
The site isn't terribly complicated. There a number of themes that can be applied to give the user different styles & functionality and most of the common elements between themes are placed in UserControls.
The problem is that, when the project is compiled, the whole thing gets built into a single, massive DLL. That means that making changes across a number of UserControls and then rolling out those changes a few at time is incredibly difficult, if not impossible.
Unfortunately, we have to assume Visual Studio 2003 and .NET 1.1.
Like I said, I'm an ASP.NET newbie so be gentle.
Is there a way to do things differently so that maybe each UserControl is its own separate DLL?
Are there other things I could change to make it easier to push out changes in small batches?
The way we do things at my current job is to compile multiple small DLL's. Controls typically have their own DLL separate from object logic so we can use objects in things like windows services. This does require recompilation of the entire project though.
We use cruisecontrol.net which has some neat features which builds the entire project in the background. You can set up projects so that when you chagne a DLL, cruise control will recompile every project that references the DLL. It's a very handy feature that takes the onus away from any one person as the build master. You just wait for cruise control to build the project and you receive a success/failure email when it is done. Not sure if this is what you're looking for. I'll be glad to go back and forth with you if you need any more help !
good luck !!
I'm starting a new personal project on the side, so this is the first time I'll be able to start from the ground up on a larger project since ASP.NET 2.0 was first released. I'd like this to also be a good learning experience for me, so right now I'm planning on building this upon ASP.NET MVC, Castle ActiveRecord, and Ninject. I'm most comfortable with MbUnit for unit testing and CruiseControl for CI so right now they are the front runners.
But what would be your first additions once you click "New Solution"? Open Source, commercial, whatever. I have an open mind if they look like they can make it do what it do.
Web Framework: MVC
Just a better way to make web applications
OR/M: NHibernate
Nothing really beats it in performance or features
Javascript: JQuery
Been using it before it got all cool. JQuery to me seems less like a framework, and more like a natural extension to the javascript language
IoC: Castle Windsor
Most mature of the .net IoC containers
CI: TeamCity
Once you try it, you will never want to go back
Testing: NUnit
They are all pretty head to head in features, I prefer the tooling (resharper) and syntax (been using it forever now)
Mocking: Rhino Mocks
Again, I like to go for maturity, especially in open source projects
In Hanselman ALT.net Geek Code, that translates to
IOC(CW):MOC(RM):TDD(NU):SCC(Svn):ORM(NH):XPP(++):DDD(T+):JSL(Jq):CIS(TC):GoF(++)
Built on nothing. Personally, I'm not a big fan of using frameworks and pre-built components for every single aspect of my project. I like to be in control of all the code, and write all the code myself. You could call it an extreme case of not invented here syndrome. Or you could say, if it's a core business function, do it yourself.
I prefer Microsoft Unity for IoC, for NHibernate make sure you look into Fluent NHibernate and say good bye to the xml garbage!
I wrote my own version of the Web Client Software Factory that leverages Unity instead of ObjectBuilder(1) that's included as I ran into numerous issues with it, at some point it will be blogged about in a series of posts but the source code is already on my site which you can view in my profile.
If your project is for an enterprise in all honesty I would recommend against using the MVC Framework. It's such a large derivation from web forms that you will find many developers that don't live and breathe coding will not be able to use it correctly and you will constantly be fighting to keep the MVC usage correct as most developers will treat it the same way as web forms.