StrataFrame Forum

Loading Selective BO in a Website

http://forum.strataframe.net/Topic4020.aspx

By Vikram Saxena - 10/31/2006

Lets say i have 10 Business Objects which i declare in ApplicationBasePage and then i inherit all my pages from ApplicationBasePage, so on load of all pages are ALL the 10 Business Objects loaded & populated or only the selective ones are loaded ?

Basically, on a Item Details page i would not like to load the CustomerBO to have less amount of processing.

Request you to please elobarate a bit on this concept and clarify my concern.

By Trent L. Taylor - 10/31/2006

All of the BOs declared in the ApplicationBasePage would be available on any page that inherits this.  But inheriting this page does not add any additional overhead.  These business objects are loaded into session variables when the session is started.  So this would be nothing more than an object reference if nothing is done on the page.

But if you do not like this approach, you can create another base page and have only those business object which you wish to have available.  You can have as many base pages as you would like.

By Vikram Saxena - 10/31/2006

Hello Trent,

I have another small problem, i have a base class which i use for all my pages in all the projects and have implemented authentication and many more useful functions. now, my base class is very generic and is not modified specifically for any project whereas the SF ApplicationBasePage needs to be modified for each project.

I want best of both the worlds and want to use my base page & SF base page as well. The best way i can think of is inherit my base class from MicroFour.StrataFrame.UI.Web.BasePage and inherit my SF ApplicationBase Page from my base class. Do you foresee any issues with this approach, for the deployment perspective, do i just need to put the StrataFrame Base.dll or any more SF Dlls in the bin folder ?

Thanks in advance

Vikram.

By Trent L. Taylor - 11/1/2006

Your approach for your base class should work just fine.  One option that we use from time to time is a shared class in cases that we need to re-use code from several locations and subclassing is not really an option.  In your case you can subclass, but just to show you another option, you can create a shared class that never requires an instance to be created and you can call directly anytime:

Public Notinheritable Class MySharedClass

'-- Prevent the class from being instantiated
Private Sub New()
End Sub

'-- A shared sub
Public Shared Sub MySharedMethod()
    '-- Do whatever you need to do
End SUb

'-- A shared function
Public Shared Function MySharedFunction() As Boolean
    '-- Do some stuff
    Return True
End Sub

End Class

As for the DLLs required, you will need the following:

MicroFour StrataFrame Base.DLL
MicroFour StrataFrame Business.DLL
MicroFour StrataFrame UI.DLL

and if you are using security you will need:

MicroFour StrataFrame Security.DLL