RSS

A Message Board, Guestbook, or Poll hosted for your website.
Iron Speed Technical Forums

Register Login New Posts Chat
 
Iron Speed > Forums > Using Iron Speed Designer V6.X > Shared Code Among Applications
 
Username:  
Password:  
 
   
 


Thread Tools Search This Thread 
Reply
 
Author Comment
 
DSThompson
Registered: 06/17/08
Posts: 182

    09/10/09 at 11:11 AMReply with quote#1

I am developing applications in a corporate environment. We have some custome security code that is used in every application. It is primarily in the aspc.vb code for each page.

Of course we are constantly improving this security code and it requires that all the applications be updated.

Is there a way place this code that is common to all of our secured pages into a share library of some kind and have all the application on the webserver use it?

To be clear, I am talking about different websites sharing code.

Thanks
steeviex
Avatar / Picture

Registered: 06/26/09
Posts: 53

    09/10/09 at 11:56 AMReply with quote#2

You could use a DLL (Dynamic Link Library). Compile It then drop it in the /Bin folder

Then use the "Imports" Keyword on top of the files (.vb files)

Example

Imports myNamespace.MySecurityLib

If you use ISD Headers then you could apply that security to every page that has that header....

NB: I hope i understood your problem well, if not someone else might post a reply




__________________
Steeves Saillant Sr Programmer-Analyst @ Imafs inc.
dingjing
Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,464

    09/10/09 at 12:08 PMReply with quote#3

Web service
jpatel
Avatar / Picture

MVP Consultant Registered: 12/18/08
Posts: 541

    09/10/09 at 01:49 PMReply with quote#4

If the code you want to share is is pure C# or VB.NET code with no UI (no .aspx or .ascx) then you can:
1) Refactor the code and place in a separate library project.  The Assembly from this project can be included in your various applications.
2) As DingJing indicated, you could share in a different sense by setting up web services that the other applications can then utilize.  This would require having a website where the web service is hosted, either as part of an existing app or a site just for web services.

I find approach #1 works better in our case as we don't have to worry about securing/encrypting web services and they're simply API calls as if the code was local.  Your requirements may be different.

If you require sharing of UI (for example .ascx components, or ASPX pages that you want to host 'within' other applications) then simply publish your project and deploy the following to existing web sites:
* {shared app assemblies} and any other required assemblies to /bin
* Shared UI resources to appropriate directory.  In our case, the shared/base application has a single folder for all the 'shared' stuff: /Framework.  We deploy the entire Framework folder to the root of new applications to provide common functionality
* Deploy necessary web.config settings needed by the shared app to the destination application.

We use the above approach for standard ASP.NET applications (non-ISD) that rely on shared UI functionality.  No reason why it wouldn't work for ISD apps as well.

As for having a 'common' security model for both ISD and non-ISD pages, that's a different matter.  You could add your own custom page 'authorization' logic to the Iron Speed base page class.


__________________
Jay Patel - jay@jnovation.com

Get Iron Speed Designer and ASP.NET tips by rss or email
steeviex
Avatar / Picture

Registered: 06/26/09
Posts: 53

    09/10/09 at 02:01 PMReply with quote#5

You could consider using the GAC also, Global Assembly Cache.


__________________
Steeves Saillant Sr Programmer-Analyst @ Imafs inc.
timt
Avatar / Picture

Iron Speed MVP
Consulting Organization

Registered: 08/06/05
Posts: 1,206

    09/12/09 at 12:19 AMReply with quote#6

Hi

I would also suggest the GAC for this item. The trick of course is to ensure the dll is standalone, depending on it's functionality and how much it depends on other components will dictate how easy this becomes to create, you may find its to much work once you bring in the ISD code and that its easier to leave in each directories bin folder.

__________________
Tim Titchmarsh
Dot Net Architect
UK Iron Speed MVP
Consulting Organisation
+44 (0)1621 857758
http://www.dotnetarchitect.co.uk
timt@dotnetarchitect.co.uk
DSThompson
Registered: 06/17/08
Posts: 182

    09/14/09 at 12:36 PMReply with quote#7

Thanks for the imput guys, I'll let you know how it goes.

Previous Thread | Next Thread
Reply

  Bookmarks  
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google

Download Iron Speed Designer

Privacy Statement