1
Thought I would start a thread to discuss this news announcement:
https://xoops.org/modules/news/article.php?storyid=6631For module programmers this is a great new feature.
For those that do not understand the importance of this feature this new Service Manager allows a module to provide a service that can be used anywhere in the system.
This feature makes the idea I have made known more than once about module Libraries pretty much a moot point.
As an example, XoopsPoll can be rewritten to serve a poll service that needs very little code to access. This then allows you to EASILY include poll's into a new forum, event module or anything you want to add it to. This also then allows one to easily upgrade the original poll module while leaving the service mostly untouched and be used by the secondary modules without having to update them. You could also then replace the xoopspoll module as long as the new module completes the original poll modules contract. It can include MORE items but it has to fulfill the original contract. If you have a new module that will perform all of the functions of the original and new ones then it makes sense to provide not only the original contract but a secondary one as well. Because a contract is an interface it is very easy to add.
In practical use we can use the example of how CBB adds polling support. Currently the code base duplicates large portions of xoops poll to allow the support but if the code in CBB doesn't match the code with Xoopspoll then CBB will be very buggy to provide the polls. If xoopspoll was a service provider then CBB can be rewritten to use this service and have no actual xoopspoll code within the module. This then makes it much easier to upgrade xoopspoll in the future or outright replace it with a similar module.
(Note, if I have time this summer I will try to move Xoopspoll to a service providing system but with other cool stuff I hope to get involved in I may not have the time.)
Attending College working towards Bachelors in Software Engineering and Network Security.