Author Topic: WPS Class List Color?  (Read 10439 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4748
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
WPS Class List Color?
« on: December 04, 2015, 10:24:34 pm »
Hi

I was checking the WPS Class List the other day.



Does anybody know what does it means the WPS classes that are marked as blue?

Regards
« Last Edit: December 04, 2015, 10:26:20 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

David McKenna

  • Hero Member
  • *****
  • Posts: 751
  • Karma: +24/-0
    • View Profile
Re: WPS Class List Color?
« Reply #1 on: December 05, 2015, 03:25:40 pm »
 I can't say that I 'know' this, but I believe the blue color indicates classes that have been replaced as opposed to just extended. If you notice, at the top of the window at the right there is a line 'Replaced with'. It appears that only the blue classes have anything written here (at least all the ones I looked at).

Regards

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4748
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: WPS Class List Color?
« Reply #2 on: December 07, 2015, 04:57:49 pm »
Thanks for the reply David. I was guessing it was also that thing but I wanted to be sure.

What I still not sure about how WPS classes works is, for example, WPDisk is on blue and XFldDisk replaces it. Does it means that all the functionality of WPDisk  had been cloned by XFldDisk and XFldDisk can work even if I remove/unregister the WPDisk class? Or XFldDisk still depends on the functions from WPDisk even it is replaced?

One of my little research goals is to try to find which WPS classes can be replaced with open source ones, in favor to dump the IBM ones.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Hero Member
  • *****
  • Posts: 1272
  • Karma: +65/-0
    • View Profile
Re: WPS Class List Color?
« Reply #3 on: December 09, 2015, 04:42:39 pm »
WPS class replacements are not full replacements in the sense of the word. They rather inherit from a parent class and declare to the WPS they "they are the first one" to be called.
In fact, they usually build on top of the functionality of the class that they replace, that is, they call into the old class and modify the result for example.
Therefore you cannot remove classes that replacement classes inherit from.

It's getting even more complicated if for example a class intends to replace WPFolder but WPFolder is already replaced by another class like XFolder. Then the new class that intends to replace WPFolder actually replaces XFolder and so on and so forth ...

You better not touch the base WPS classes WPObject, WPAbstract, WPTransient, WPFileSystem, WPFolder, WPDataFile or you are going to drop into a deep and dark hole.

Example: the XWPS classes replace and enhance some undocumented functionality of WPFolder. If you don't get your open source WPFolder replacement right then you are in deep shit trouble.

Lars

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4748
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: WPS Class List Color?
« Reply #4 on: December 10, 2015, 04:51:52 pm »
Hi Lars.

I think it can be interesting to experiment replacing the base WPS classes (WPObject, WPAbstract, WPTransient, WPFileSystem, WPFolder, WPDataFile). It is an experiment, it can be done on Virtual Machines, and test scenarios. I understand that we may not have the resources as a community to do that, but I don't think that "FEAR" should be a reason not to do that.

Back to the subject. I understand that when you create a WPS class based on other (a child of it) it inherits the functions from the father, and of course it requires the father's binaries (DLL) to run. But I was thinking that maybe the blue ones was complete replacements, but I was wrong with that one.  I saw for example "xwpmouse.idl" and it calls "#include <wpmouse.idl> ".

Trying to create "XWPMouse" as a child of "WPAbstract" instead of "WPMouse" can be an interesting as an experiment. The idea will be for "XWPMouse" to became a full replacement of "WPMouse" and not a child of it.

Regards.

Martin Iturbide
OS2World NewsMaster
... just share the dream.

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Re: WPS Class List Color?
« Reply #5 on: December 11, 2015, 10:55:42 am »
Subclass = Replace only parts of the complete set that need the additional features.

So someone need to add code that is currently not present in the subclass.

Lars

  • Hero Member
  • *****
  • Posts: 1272
  • Karma: +65/-0
    • View Profile
Re: WPS Class List Color?
« Reply #6 on: December 11, 2015, 04:56:56 pm »
You can experiment all the way you want.
But the whole idea of making the WPS object oriented is to inherit functionality. One class inherits from another for a good reason. The reason is to not rewrite functionality that can be offered in a generic way.
There is no way to make XWPMouse a subclass of WPAbstract unless you rewrite the COMPLETE functinality of WPMouse. Your suggestion just makes no sense unless you can provide man years of developer hours and know all of the WPS internals.
I can tell you the outcome of making xWPMouse a subclass of WPAbstract. You effectively have no mouse configuration functionality whatsoever. WPAbstract is a base class that you cannot even create instances of. It just provides bare minimum functionality: you can save persistent data in the OS2.INI file, you get a settings notebook with the standard pages, you could set/query object title etc.


Lars

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4748
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: WPS Class List Color?
« Reply #7 on: December 11, 2015, 07:43:41 pm »
Hi Lars

Your suggestion just makes no sense unless you can provide man years of developer hours and know all of the WPS internals.
How many man years do you calculate for cloning WPMouse?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Hero Member
  • *****
  • Posts: 1272
  • Karma: +65/-0
    • View Profile
Re: WPS Class List Color?
« Reply #8 on: December 12, 2015, 10:35:35 am »
I am not talking about WPMouse and you know it. That would not take more than say 1/2 year full time.
I am talking about replacing WPObject,WPAbstract,WPTransient,WPFileSystem,WPFolder,WPDataFile.
Replacing these and ensuring that all WPS classes that are derived from them (that is, all user additions like for example XWorkplace) still work correctly would likely take in excess of 20 man years full time. Just think about all the regression testing that would be necessary.

Lars