Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

let component create html code 2

Status
Not open for further replies.

Ekstrom

Programmer
Feb 13, 2001
9
SE
for a small server, 256 Mb memory and 600Mhz pentuim III processor is it then a bad solution to have the component to write the HTML code to ASP, instead of having all html code directicly in ASP.
If the site, in the future, is frequently used will it then be processor intensive to send 10Kb data from component to ASP?

Does anybody have an idea?
 
It is not a good solution to have the component to write the HTML code to ASP.From the point of mine it is better to implement business logic in component and use ASP to present UI(User Interface).


Regards! zallen@cmmail.com
ICQ:101229409
Long live of freedom!
 
Zallen,
Actually, Business objects can be grouped into 2 categories. UI-Centric and Data-Centric. You can have Bus. Obj. (the UI-centric ones) that are responsible for generating HTML (usually when you plan on having dynamic screen content). A very good example of this idea is the Use of WebClasses (which I prefer to use rather than ASP). Of course, these DLLs would have NO BUSINESS RULES inside of them. All "true business objects" would still reside in MTS.

Ekstrom,
No, passing 10K of data is not a big deal . . . just be sure that if the data is going to cross a process line or travel over the network, be sure that you pass it ByVal and not ByRef. And whatever you do, DO NOT PASS OBJECT REFERNCES! This is true for ByVal and ByRef.
- Jeff Marler
(please note, that the page is under construction)
 
Ekstrom -

A lot depends on how complex your application architecture is (3-tier, 4-tier, n-tier, etc). I like to keep my UI code in the ASP files. But if the code you're outputting is so complex that the ASP becomes unmaintainable, then it would make sense to put it into a component where you can structure it a little better.

Oh, and what Jeff said about passing Object references goes double for me. Just don't do it. If you absolutely have to pass an object around, you should serialize it into a string using something like XML.

Chip H.

 
With the object references, i'm not exactly sure what you mean. I pass the connection (object) from one function to some other functions. Ex:

calcBirthDate(Cint(intID), objConn)

Private Function calcBirthDate(ByVal intID As Integer, objConn As ADODB.Connection) As Integer
...
End Function

I have some other functions that return the recordset to asp like:

Public Function getContactData(...) As ADODB.Recordset
...
getContactData = objRS
End Function


Is something here not a good idea? Can I put byVal on the connection object????

Thanks!
/Martin
 
Ekstrom,
Passing objects references to private functions/subs is fine. As a general rule, however, I never put any complex varaible type (objects, UDTs) on any public interface. All of my public interfaces use basic variable types (string, integer, long, etc). If I have more complex data to pass through a public interface, I serialize it . . . either with a custom marshaller that I wrote or basic XML. You can do this with your ADO recordset since ADO recordsets will automatically produce their own XML. - Jeff Marler
(please note, that the page is under construction)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top