473,833 Members | 2,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transition from ASP/COM+ to ASP.NET model

I have been developing ASP applications for quite a while now. Most of the
apps that I deploy are a typical n-tier setup. ASP GUI on a web server,
Business and Data Components written in VB6 running in COM+ on a separate
server with the SQL database residing on its own server.

I don't really use COM+ for the transactions but more for the DCOM
capabilities and as a way to control the running program. If I need to
compile out a new version of an component and the website is being used I
can just stop the component and then compile it out. Otherwise VB won't let
me compile it out because the component is in use.

My question is how does this translate to ASP.NET. I have read many
articles but have never come across an answer that answers this question for
me. I guess I'm wondering what the best practices are with is comes to
deployment.

Should a lot of the business and data logic I write be contained on the
webserver in the Code Page Behind? Or should I separate it out into like I
am currently doing? If I deploy it like that and need to update components
can I compile over the version out there even if its being used or will I
get an error because the dll its trying to update is in use?

I know there is a right or wrong answer, I'm just looking for the most
accepted way of doing it as a starting point.

Mike
Nov 15 '05 #1
3 1523
"Mike" <mr********@NOS PAMATALLcalibru s.com> wrote in message
news:O0******** ******@tk2msftn gp13.phx.gbl...
I have been developing ASP applications for quite a while now. Most of the apps that I deploy are a typical n-tier setup. ASP GUI on a web server,
Business and Data Components written in VB6 running in COM+ on a separate
server with the SQL database residing on its own server.
Wow, RAD!! Been there and loved every minute of it.
I don't really use COM+ for the transactions but more for the DCOM
capabilities and as a way to control the running program. If I need to
compile out a new version of an component and the website is being used I
can just stop the component and then compile it out. Otherwise VB won't let me compile it out because the component is in use.
You can register your COM+ app as Server application instead of a Library
application. This way, your app runs in its own DLLHOST.EXE process instead
of running inprocess with inetinfo.exe. It's easier to shutdown the
component in Component Services this way so you can recompile. Also, you
can designate your IIS virtual directory to run High (Isolated) protection.
Your virtual directory will also run in its separate instance of DLLHOST.EXE
that you can find in Component Services. You should avoid running both the
virtual dir and the component in their own DLLHOSTs for performance reasons
(cross-process marshalling, etc). What I used to do is run the virtual dir
in High(Isolated) and run the COM+ app as a Library application. If you
need to replace the dll, simply Unload the virtual directory inside IIS
Manager to release the dll.

My question is how does this translate to ASP.NET. I have read many
articles but have never come across an answer that answers this question for me. I guess I'm wondering what the best practices are with is comes to
deployment.
Have a look at the Duwamish example on MSDN:
http://msdn.microsoft.com/library/de...duwamish70.asp
It's even better if you can download the whole solution so you can see the
Enterprise template they use. My team and I generally stick to this
methodology, now. Start with a solution, add a Web project, add another
project for the Business Facade, add another project for Business Rules, add
another project for Data Access and maybe other common data objects. Add a
database project to house our stored procedures

Should a lot of the business and data logic I write be contained on the
webserver in the Code Page Behind? Or should I separate it out into like I am currently doing? If I deploy it like that and need to update components can I compile over the version out there even if its being used or will I
get an error because the dll its trying to update is in use? No. Use code-behind to separate presentation code from the aspx page - i.e.
no more "<%%>" tags and "<script runat=server>" tags . Use code-behind also
to handle postback events and to call Business Logic layers through the
Business Facade layer. Example, have the code behind call BusinessFacade to
call DataAccess to request a DataTable, then set a DataGrid's DataSource to
the DataTable and call DataBind(). The important thing is to keep
BusinessFacade the public interface, i.e. code-behind should never directly
call the DataAccess layer.
I know there is a right or wrong answer, I'm just looking for the most
accepted way of doing it as a starting point.


I don't think there is a right or wrong answer. It starts to become an art
after a while, then it becomes a matter of style. Two sets of code may do
identical things but one may look more elegant and perform better than the
other.

Nov 15 '05 #2
> > My question is how does this translate to ASP.NET. I have read many

There's a whole help section on COM Interoperabilit y in Visual Basic and Visual C# in the Visual Studio 2002 help section. Here's the local link:

ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vaconCOMInterop erability.htm

I think it's somewhere in MSDN also. I included the mIN page below.
Have a look at the Duwamish example on MSDN:
Excellent advice!
I don't think there is a right or wrong answer. It starts to become an art
after a while, then it becomes a matter of style. Two sets of code may do


I don't exactly agree with this. There are good standards and there are no standards. Emulating the multi-tier design of Duwamish is a good standard. You'd never adopt it as a style if it was not a good thing. MS had their geniuses spend hours on coming up with it. It's practical and elegant, although it's not really that big of an application. For high performance web sites it's designed well as stated in the documentation. If your application also needs back end WinForms, I think the Fitch example fits although I haven't totally gotten into it. Northwind seems a bit outdated at first glance. I read somewhere that MS will soon publish a full blown shopping cart as a example to emulate which far exceeds what Duwamish does. Could Duwmaish be improved? Probably! Wouldn't it be great if it were an open source type thing like the Apache.org RFQ where everyone always can tweak it to perfection.

I like the database design of Duwamish also. Using that PKey int 4 for all primary keys is good for relations and quick access.

--

Visual Basic and Visual C# Concepts

COM Interoperabilit y in Visual Basic and Visual C#
When you want to use COM objects and .NET objects in the same application, you need to address the differences in how the objects exist in memory. A .NET object is located in managed memory - the memory controlled by the common language runtime - and may be moved by the runtime as needed. A COM object is located in unmanaged memory and is not expected to move to another memory location. Visual Studio and the ..NET Framework provide tools to control the interaction of these managed and unmanaged components. For more information about managed code, see Common Language Runtime.

In addition to using COM objects in .NET applications, you may also want to continue to develop COM objects using Visual Basic .NET or Visual C# ..NET.

The links on this page provide information about the concepts and implementation details for interoperating between COM and .NET objects.

In the Visual Basic and Visual C# Documentation
COM Interop
Provides links to topics covering COM interop in Visual Basic, including COM objects, ActiveX controls, Win32 DLLs, managed objects, and inheritance of COM objects.
COM Interop Part 1: C# Client Tutorial
Shows how to use Visual C# to interoperate with COM objects.
COM Interop Part 2: C# Server Tutorial
Describes using a Visual C# server with a C++ COM client.
COM Interop Wrapper Dialog Box
Discusses the assembly wrapper that Visual Studio can build for COM object references in Visual Basic and Visual C# projects. This wrapper is generated if the project system cannot find a registered interop wrapper for the COM component.
Additional Information
Interoperating with Unmanaged Code
Briefly describes some of the interaction issues between managed and unmanaged code, and provides links for further study.
COM Wrappers
Discusses runtime callable wrappers, which allow managed code to call COM methods, and COM callable wrappers, which allow COM clients to call ..NET object methods.
Advanced COM Interop
Provides links to topics covering COM interop with respect to wrappers, exceptions, inheritance, threading, events, conversions, and marshaling.
Type Library Importer (Tlbimp.exe)
Discusses the tool you can use to convert the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly.
Nov 15 '05 #3
> > My question is how does this translate to ASP.NET. I have read many

There's a whole help section on COM Interoperabilit y in Visual Basic and Visual C# in the Visual Studio 2002 help section. Here's the local link:

ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vaconCOMInterop erability.htm

I think it's somewhere in MSDN also. I included the mIN page below.
Have a look at the Duwamish example on MSDN:
Excellent advice!
I don't think there is a right or wrong answer. It starts to become an art
after a while, then it becomes a matter of style. Two sets of code may do


I don't exactly agree with this. There are good standards and there are no standards. Emulating the multi-tier design of Duwamish is a good standard. You'd never adopt it as a style if it was not a good thing. MS had their geniuses spend hours on coming up with it. It's practical and elegant, although it's not really that big of an application. For high performance web sites it's designed well as stated in the documentation. If your application also needs back end WinForms, I think the Fitch example fits although I haven't totally gotten into it. Northwind seems a bit outdated at first glance. I read somewhere that MS will soon publish a full blown shopping cart as a example to emulate which far exceeds what Duwamish does. Could Duwmaish be improved? Probably! Wouldn't it be great if it were an open source type thing like the Apache.org RFQ where everyone always can tweak it to perfection.

I like the database design of Duwamish also. Using that PKey int 4 for all primary keys is good for relations and quick access.

--

Visual Basic and Visual C# Concepts

COM Interoperabilit y in Visual Basic and Visual C#
When you want to use COM objects and .NET objects in the same application, you need to address the differences in how the objects exist in memory. A .NET object is located in managed memory - the memory controlled by the common language runtime - and may be moved by the runtime as needed. A COM object is located in unmanaged memory and is not expected to move to another memory location. Visual Studio and the ..NET Framework provide tools to control the interaction of these managed and unmanaged components. For more information about managed code, see Common Language Runtime.

In addition to using COM objects in .NET applications, you may also want to continue to develop COM objects using Visual Basic .NET or Visual C# ..NET.

The links on this page provide information about the concepts and implementation details for interoperating between COM and .NET objects.

In the Visual Basic and Visual C# Documentation
COM Interop
Provides links to topics covering COM interop in Visual Basic, including COM objects, ActiveX controls, Win32 DLLs, managed objects, and inheritance of COM objects.
COM Interop Part 1: C# Client Tutorial
Shows how to use Visual C# to interoperate with COM objects.
COM Interop Part 2: C# Server Tutorial
Describes using a Visual C# server with a C++ COM client.
COM Interop Wrapper Dialog Box
Discusses the assembly wrapper that Visual Studio can build for COM object references in Visual Basic and Visual C# projects. This wrapper is generated if the project system cannot find a registered interop wrapper for the COM component.
Additional Information
Interoperating with Unmanaged Code
Briefly describes some of the interaction issues between managed and unmanaged code, and provides links for further study.
COM Wrappers
Discusses runtime callable wrappers, which allow managed code to call COM methods, and COM callable wrappers, which allow COM clients to call ..NET object methods.
Advanced COM Interop
Provides links to topics covering COM interop with respect to wrappers, exceptions, inheritance, threading, events, conversions, and marshaling.
Type Library Importer (Tlbimp.exe)
Discusses the tool you can use to convert the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly.
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3450
by: Terry | last post by:
Hi, I am looking for a javascript that can do a banner rotation of multiple images with nice transition between them. The pictures will be displayed automatically upon loading the pages. Thanks in advacne, Terry
3
5078
by: Richard A. DeVenezia | last post by:
I hope this is the end of my present 'discovery' phase. I've learned alot about JavaScript in a short time and my head hurts. The following is what came out of all my questions and all the excellent answers (thanks!). It will be the basis of a slightly more complicated function for rendering a two-level navigation bar ( Don't have time to get into design of a multi-styletype renderer for n-level hierarchies. ) This is a single function...
5
2860
by: _BNC | last post by:
I've been adapting an older unmanaged C++ legacy app to C#---with limited success. The original app made use of an older, but straightforward, C DLL that worked efficiently under the VC++ 6 model. To adapt to C#, I've wrapped the older DLL calls in an unmanaged C++ class which pretty much just parallels the original function calls and encapsulates the more ragged aspects (handles, etc). Then in turn, I wrapped the unmanaged C++ class...
8
3057
by: Workgroups | last post by:
I've got a page where the nature of the beast is such that the user clicks a submit button to ransomize some data in somewhat rapid succession (once per second, give or take). The page generates a little table, 10x10, of small pictures that represent the randomized data. The submit button tells the server (which is keeping track of which pictures are where) to scramble them around and output a new table. The output is simple HTML. The...
1
3147
by: Busy | last post by:
Hello Everyone Please can someone point me in the direction of a really good tutorial or discussion on PHP page transition? What I'm looking for is coverage of page transition that covers: Breaking out of frames in PHP - for and against arguments with examples; Carrying forward variables - the various methods of moving variables from
1
329
by: Mike | last post by:
I have been developing ASP applications for quite a while now. Most of the apps that I deploy are a typical n-tier setup. ASP GUI on a web server, Business and Data Components written in VB6 running in COM+ on a separate server with the SQL database residing on its own server. I don't really use COM+ for the transactions but more for the DCOM capabilities and as a way to control the running program. If I need to compile out a new...
2
2701
by: Emil | last post by:
Hi, if you open the link below and click on "Show Me" and then "Toggle Transition" Button you will see a wonderfull fade in / fade out transition of 2 pictures. http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/fade.asp I want to have the same effect in Visual C++, dosen't matter with / or without GDI+, but no .NET. I have a simple dialog with some controls and I
14
5972
by: Gale | last post by:
I wrote a simple script for image rotation. now i need to have some transition effect betwean images in JS What do you suggest ? Thank you
1
3745
by: papalazarou78 | last post by:
Hi I've been experiementing with actionscripting transitions between sections... this is the first site I have tried this with (last 3 had swf loaded in one after another rather than transitioned between). I used some code from kirupa.com which works for loading movies in and out, but I also have some code for my movie buttons. I can get one or the other working, but not together, so I guess I'm clashing code somewhere, I could do with some...
0
10500
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10543
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4422
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.