Hello to everyone,
again, I want to trigger a discussion on a rather abstract topic in the ecosystem of Nextcloud and its apps: Integration between foreign apps.
I am developing one app on the NC app store so far. There are quite some requests to integrate the app with this and that other app, like the calendar, the deck, the notes, carnet, etc.
I can understand the wish to have all these pieces glues together as neatly as possible. This is one of the ideas to have a NC server and it is promoted that way as well. For the core apps, this is realized quite reasonably (or on the way there). You can share files to a circle and use that circle in talk to have a quick chat on things etc. All nicely and neatly integrated.
The problem appears when it comes to third party apps. For a common user, the difference is not easy to explain. Even I am unsure from time to time, if a certain app is supported by the core team or just a third-party app. I, personally, find it sort of hard to and tiring to explain over and over that it is currently not possible to connect the shopping list of the cookbook with the deck app for example.
Using and accessing other third-party apps using classes in
OCA\<other app>\ might work but will eventually break easily. I would not consider this a good design. I have read a few posts here that discourage the direct access of remote classes rigorously.
Sending events using the event dispatcher might work better as the code is less coupled. Also, if an app is not installed/available/… the event can simply not be received in the worst case. No big breakdown is to be expected.
Essentially, the same argument holds true for accessing any foreign API endpoints from the frontend. These are prone to update and might break from version to version and create a tight coupling between the various apps.
This means, that all app developers would need to implement a certain event system (based on the OCS event dispatcher, similar to e.g. DAV with
\OCA\DAV\Events\...) in their apps as soon as the app has reached a certain maturity. Also, versioning issues might arise if the event’s definition or payload evolve over time. So, this should be thought through carefully and a best practice should be derived. This can then be used for all third party apps.
Maybe there are even better approaches possible? Do you have any better idea? Or is there even something I am not aware of so far?
Long story short: I would like to start a discussion on how integrations between different apps could be created in the mid to long-term time span for all (interested) apps. Then, some sort of best practices should be published in the dev documentation and any required update to the core might be carried out.
Considering the big goal of the NC ecosystem to integrate all sorts of functionality, it would be good to have a clear view on how this agenda might be achieved. I am posting this topic here for discussion, ideas, optinions, and suggestions. I hope it will get some traction and eventually, the discussion lead to a solution in the long run.