Announcement

Collapse
No announcement yet.

Aggragate objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aggragate objects

    Hey all

    I would like to aggragate objects off of a single primary object.
    For instance, I have an object called foo with 3 object a, b and c. All of these objects have read only properties that will be drived from the main object. I can not see a way to get this information to these objects. In C++ I would pass this info view the constructor but you cant do that here..

    What were your solutions?

    Thanks
    Sr. Software Development Engineer and Sr. Information Security Analyst,
    CEH, Digital Forensic Examiner

  • #2
    You could create an "Initialize" method that can only be called one time right after object creation. It takes what is done in C++ and turns it into two steps. You can set an Instance variable to show that the object has been initialized so subsequent calls to the "Initialize" method would be ignored.
    Scott Slater
    Summit Computer Networks, Inc.
    www.summitcn.com

    Comment


    • #3
      Thanks for the response Scott!1

      The one problem I am having is conceptualizing setting private/read only data from the base object to the aggragate objects.

      Any thoughts?
      Sr. Software Development Engineer and Sr. Information Security Analyst,
      CEH, Digital Forensic Examiner

      Comment


      • #4
        Originally posted by Thomas Tierney View Post
        Thanks for the response Scott!1

        The one problem I am having is conceptualizing setting private/read only data from the base object to the aggragate objects.

        Any thoughts?
        Unfortunately the INSTANCE variables are not inherited from the parent class (like in C++), so they cannot be directly modified from derivative classes. I think this is because PB is only following the COM spec. There are only 2 ways that I can see around this. 1) Use globals and move classes into a DLL (making the globals private to only the classes within the libary) or 2) you will have to have methods in the parent class that allow modifying the private variables (but then they're really not private are they).
        Scott Slater
        Summit Computer Networks, Inc.
        www.summitcn.com

        Comment


        • #5
          Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.
          Sr. Software Development Engineer and Sr. Information Security Analyst,
          CEH, Digital Forensic Examiner

          Comment


          • #6
            Originally posted by Thomas Tierney View Post
            Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.
            Don't forget C#
            Scott Slater
            Summit Computer Networks, Inc.
            www.summitcn.com

            Comment


            • #7
              Originally Posted by Thomas Tierney
              Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.
              VB!, I Thought the problem was that PB was only capable of dealing with COM in the same manner as VB. VB only has the default paramaterless constructor, VB does not allow inheritance per se.

              If you know how to do it in VB then you should be able to do it in PB.

              Comment


              • #8
                meant to say VB.NET
                Sr. Software Development Engineer and Sr. Information Security Analyst,
                CEH, Digital Forensic Examiner

                Comment


                • #9
                  Originally posted by Thomas Tierney View Post
                  Hey all

                  I would like to aggragate objects off of a single primary object.
                  For instance, I have an object called foo with 3 object a, b and c. All of these objects have read only properties that will be drived from the main object. I can not see a way to get this information to these objects. In C++ I would pass this info view the constructor but you cant do that here..

                  What were your solutions?

                  Thanks
                  Not sure if this is the same as inheritance?
                  In my class i often add a 'backdoor' interface.
                  This interface set's the values.
                  Using a macro i can instantiate and set some data, then it looks a little as there was a constructor with params
                  hellobasic

                  Comment


                  • #10
                    Thats an option but I am having a problem with PB returning objects in VBScript. I have an email to support on that but it has been a week now and no response.
                    Sr. Software Development Engineer and Sr. Information Security Analyst,
                    CEH, Digital Forensic Examiner

                    Comment

                    Working...
                    X