The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Discussion on ID vs DISPID (OOP)
Author Message
Capes
Journeyman
*

Posts: 57
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Mar 2018
Reputation: 0



Post: #1
Discussion on ID vs DISPID (OOP)
Alright I'd like to discuss the differences in ID and DISPID.
There seems to be a lot of confusion in the forums of the properties and their use. Now this discussion will have meaning if the reader has a programming background else it will probably only confuse you.

It's my observation that DISPID has no OOP (object oriented programming) functionality. It only effects the appearance of the object.
Example-
make a shovel -> .add i_shovel
change it's appearance -> .set DISPID i_barrel
update to show change -> .update
Now the shovel appears as a barrel, but any and all queries on the object will display i_shovel properties.
So the shovel looks like a barrel but remains to be a shovel.
So queries on the shovel return shovel properties (though it looks like a barrel) and it sill behaves like a shovel.

Now ID seems to use basic inheritance (a shallow, single level is-a OOP principle). Meaning that by assigning an ID to an object, the object will now behave like the new ID. Meaning old object is-a new object. But seems to be restricted to a single level of heritance not multiple inheritance. Also it does not retain it's base class (as in normal OOP). So it's no longer the old object.
Example-
make a shovel -> .add i_shovel
change it's id -> .set ID i_dagger
update to show change -> .update
The shovel is in fact a dagger now with all the dagger properties.
That's because shovel is-a dagger now with everything relating to a dagger. All things shovel are gone.


Hope that helps!
Feel free to correct me here or add to this discussion!

Thanks
Capes
(This post was last modified: 04-14-2018 11:58 PM by Capes.)
04-14-2018 10:54 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Discussion on ID vs DISPID (OOP) - Capes - 04-14-2018 10:54 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)