Solved

ASP needs rewrite to Object Oriented.

Posted on 2004-03-23
16
212 Views
Last Modified: 2010-05-01
Hi,  I have a huge custom e-commerce application (which works in a similar way to an auction site, matching buyers with sellers).  It is all done in ASP, no VB COM object for this one.

Using only asp was great up to a point, but now the application is suffereing form being difficult to maintain and scale.  It needs some sort of object oriented arcitecture.  I used to use VB COM objects in the past, but I understand that this way of doing things is obselete, having been replaced by .net.  Is that true?

Could I run ASP with a VB component on win 2003 server?

My main problem is that I dont have time to learn a different language.  Ideally I'd like to be able to cut and paste the major functions from my ASP page, arrange them correctly, compile the executable and thats it......

So you can see my problem, I dont have time to learn a new language, but I want to be able to use my existing code in a way which will not be obselete..

What would you do?
0
Comment
Question by:rosshind
  • 7
  • 6
  • 2
  • +1
16 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
"Could I run ASP with a VB component on win 2003 server?" YES

while VB.NET is a 'new' language, you will find that it is NOT all that different from VB6.  It is sort of like learning Italian if you already know Spanish, and NOT like learning Chinese if you already know Greek.

AW
0
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
>>It is sort of like learning Italian if you already know Spanish, and NOT like learning Chinese if you already know Greek.

To me, they are all different.  8->
0
 
LVL 9

Expert Comment

by:dancebert
Comment Utility
0
 

Author Comment

by:rosshind
Comment Utility
Thanks arthur,

I could reprogram it in JAVA, i'm familliar with that language, the problem is that I just dont have enough time.  I need something which I can cut from ASP / VBScript paste into the VB.net, change a few bits using find and replace,  reconfigure teh arcitecture of the code using OO techniques,  compile it to resolve the other errors  then it would be up and working.

Naturally, its not so easy if I'm to do it in JAVA.  Would that be feasable in VB.NET?

Thanks dancebert, but if I dont have time to rewrite this in a new language, I certainly dont have time to teach anyone how the application should work...
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
you can also use J# in .NET (which is syntactically IDENTICAL to JAVA)

The biggest problem with simply Cut and Paste is that your ASP pages are either using JavaScript (on the Client) or VBScript on the Server.  VBScript is NOT VB 6, but rather a somewhat restricted sub-set of VB 6, and the translation from VBScript to VB is not a clean one.  Similary, JavaScript IS NOT JAVA - not even close.

And VBScript is different enough from VB.NET that simple cut-and-paste would create FAR MORE problems, in the 'upgrade', than you would have if you re-wrote it, either from scratch in VB.NET, or in J# (yes, you can use J# as the code-behind language in ASP.NET)

Sorry, but that is how it is.

AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
my advice would be to take a deep breath, resign yourself to the fact that this 'upgrade' is going to take some time (no, you will not get it done in a couple of days - more like a couple of MONTHS), and accept the fact the the site may/will run rather slowly, due to performance issues, in the mean time.

AW
0
 

Author Comment

by:rosshind
Comment Utility
Thanks for your help arthur.

A rewrite is not feasible, it would take 6 to 8 months.  My business would go bust for sure if i spent that much time on it.  I can cut and paste the vbscript into VB, review it then it would work, I'm familliar enough with both languages for that.

You said VB.net was not that different from VB 6. Is a cut and paste (with extensive modifications) feasable for vb6 to VB.net?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
probably not, as VB.NET is a strongly TYPED language, where the original VBScript is UNTYPED - everything in VBScript is a VARIANT (you cannot Dim var as String, in VBScript, only Dim var)

With VB6, when you Dim var, VB 6 treates that as if you had said, Dim var as VARIANT.

VB.NET does NOT allow VARIANT as a type - VARIANT does not exist in .NET.

In turn, it sounds as though all of your VBScript code is essentially PROCEDURAL, with no Objects defined in your code.  VB.NET is much more strongly oriented toward the OO perspectve, and thus you will probably end up with almost as big a re-write job on your hands as you would have starting from scratch.

One of the reasons for going OO for your ASP.NET app, is to move as much of the funcntionality OUT of the ASP.NET pages themselves, and into a common set of Objects, defined in an independent set of DLLS, that are then accessed from the ASP.NET code.  But your current ASP pages are not strucutred that way.  It is not just a matter of cutting and pasting the existing code into the DLL code.  You will need to do as careful and thorogh re-design of the entire application, from the ground up.  This type of undertaking does not lend itself easily to a simple 'cut-and-paste' approach.

I take it that you are the sole developer of this site?

AW
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 9

Expert Comment

by:dancebert
Comment Utility
> I can cut and paste the vbscript into VB

So, it looks like a straight port to VB

> I certainly dont have time to teach anyone how the application should work...

If you're doing a straight port, you don't have to.  Hand the existing app to a decent developer who knows ASP and VB and he'll hand you back the same functionality with different underpinnings.  





0
 

Author Comment

by:rosshind
Comment Utility
I know ASP and VB, I can do that, that dancebert, but that doesnt really answer my question.  

The problem is that it isnt a good idea to use obselete technology when upgrading the way a site works...  Thats why I'm asking about .net etc..
0
 

Author Comment

by:rosshind
Comment Utility
Arthur,

That was not my question.  the feasability ofVB6 into VB.net transalation.  Not VBScript into vb.net.

I certainly dont expect to be able to cut and paste VBScript into VB and leave it at that.  As you say, it needs total restructuring into objects and typing, but thats not a problem I  can do that (i've done it before with applications).  I'm well versed in OO principles with VB 6 or with JAVA.  I'm well aware of the basics of typing that you posted.

I'm just not aware of .net, how it works and how different it is form using a VB 6 dll in combination with ASP.  I assume I could use a vb.net dlls with the .net scripts programmed in c#  or something??

Once the rewrite is done, I'll be keeping the presentation layer seperate form the business / logincal and data layers, so there wont be much logic in the scripts

From what you are saying VB.net is not very different at all form VB6..  its just the next version..?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
I was not suggesting Cut-and-Paste of the VBScript to VB.NET.  But the transition from VB 6 to VB.NET will not be clean, either.  Not at all sure I understand what you are getting at with " I assume I could use a vb.net dlls with the .net scripts programmed in c#  or something??"

What .NET Scripts are you refering to.  .NET does NOT use scripts, other than some very basic stuff in Javascript (and that is genrally NOT created by the developer).  Actually, no, VB.NET is MUCH more than just the next version of VB 6 (as I indicated earlier, it is a different, though related language - akin to the relation between Spanish and Italian.  While similar enough that you can learn one fairly quickly, if you already know the other, it is NOT possible to land in one country, speaking only the other language, and be able to get along - there is still quite a learning process that must take place)

My point about VBScript --> VB6 --> VB.NET was that while the VBScript --> VB 6 is fairly easy, as VBScript is a non-typed lanuage, and with the cut-and-paste, VB 6 will convert all of the variables to VARIANTs, and the rest  of the language is pretty straight-forward.  But then trying to upgrade from VB6 to VB.NET will not be as smooth as you would seem to expect.

My guess, without seeing any of the ASP code that you already have, is that you are going to have a VERY significant amount of 'conversion' clean-up, after the move from VB 6 to .NET, and that will probably be of the same order of magnitude as it would have been had you started over, from scratch, in the first place.

AW
0
 

Author Comment

by:rosshind
Comment Utility
so VB doesnt follow the architecture of having the presentation layer in scripts and the business logic in the .dll then?

Where does the presentation layer go?
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 500 total points
Comment Utility
If you are speaking of ASP.NET, then the HTML and the ASP.NET controls ARE the presentation layer, and the CODE-BEHIND (VB.NET) is what is used to interact with the UI.  The VB.NET code (in the CODE-BEHIND for each ASPX page) is compiled into a SINGLE DLL, which holds ALL of the compiled code, for ALL of the ASPX pages.  You can also use a separate DLL (or set of DLLS to handle the business logic), to be accessed from the code-behind for each page.  In that sense, no, ASP.NET does NOT use scripts for the Presentation layer.

The code-behind is fully compiled, and can be written in ANY .NET language, VB.NET, C#, J#, C++.NET, or whatever.  And by being fully compiled, it can be very fast - as opposed to intepretted VBScript.

This is part of why I said that the transition will not be nearly as clean or easy as you seem to think.

AW

0
 

Author Comment

by:rosshind
Comment Utility
Thanks for all of your help.  Great answer.  I'm going to do the cut and paste thing into vb 6.  Once thats done, If my client wants to upgrade his server( to use .net) or something then I'll either hide or charge plenty..

Thanks..
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
good luck, and glad to be of assistance.

AW
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now