Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom Business Objects and Data AccessCustom Business Objects and Data Access
Previous
 
Next
New Post
1/15/2007 10:56 PM
 

Hi,

I have been looking at the documentation on data access and custom business objects. I think I understand how it all works. It looks like there must be a one to one correspondence between the column names from the database query and the properties in the custom business object. Is that correct? It also looks like it would not be possible to fill an array within a custom business object using the standard FillObject or FillCollection methods in the CBO class. Is that correct?

 
New Post
1/16/2007 8:42 AM
 


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/16/2007 11:41 AM
 

You might want to consider not using the CBO classes - depending on your needs, as they use Reflection and are therefore inherently slower than other code.

If you would like to consider that approach, check out FillModuleInfo/FillModuleCollection in ModuleController or FillPortalInfo/FillPortalCollection in PortalController, as examples of how to write your own "hydrator".


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
1/16/2007 12:27 PM
 
Thanks for the quick replies guys. Charles, I’ll definitely check out FillModuleInfo/FillModuleCollection and FillPortalInfo/FillPortalCollection if for no other reason than to increase my knowledge of DNN but would you agree that a custom “hydrator” is required given the following. Say we have a custom business object instantiated using this class:
 Public Class CustMember
 
       Private m_lastName As String
       Private m_firstName As String
       Private m_Certifications() As String
                  .
                  .
                  .
 
        Public Property LastName() As String
            Get
                Return m_lastName
            End Get
            Set(ByVal Value As String)
                m_lastName = Value
            End Set
        End Property
 
        Public Property FirstName() As String
            Get
                Return m_firstName
            End Get
            Set(ByVal Value As String)
                m_firstName = Value
            End Set
        End Property
 
                  .
                  .
                  .
 
        Public Property Certification(ByVal idx As Integer) As String
            Get
                Return m_Certifications(idx)
            End Get
            Set(ByVal Value As String)
                m_Certifications(idx) = Value
            End Set
        End Property
 
     End Class
 
I don’t see an aesthetically pleasing or efficient way to load the array m_Certifications using DAL/CBO. Note that each member has X number of certifications. I was going to use a ReDim m_Certifications(CertNbr) in a constructor to set the size. It looks like it would be better to build a custom “hydrator” method to fill objects instantiated from this class. Am I missing something or could I modify this class in some way that is not obvious to me?
 
New Post
1/16/2007 12:55 PM
 

Yes - you are correct, the CBO can only handle simple value types as proeprty.


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom Business Objects and Data AccessCustom Business Objects and Data Access


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out