← Back to team overview

ubuntu-phone team mailing list archive

Re: Applications spawning other Applications

 

On Sun, Jul 21, 2013 at 8:16 PM, Alexander Antimonov
<alexander.antimonov.od.ua@xxxxxxxxx> wrote:
> On Sun, Jul 21, 2013 at 8:57 AM, Thomas Voß <thomas.voss@xxxxxxxxxxxxx> wrote:
>> Hmmm, I think applications knowing one another's names and assuming
>> them to be available will result in tight coupling and introducing
>> dependencies that we cannot resolve automatically. I would consider it
>> similar to not relying on an interface to request functionality but
>> instead relying on one possible implementation  of an interface.
>>
>> Thomas
>
> If an application is supposed to run other application as part of its
> functionality, it should know other app's "name". This is not much different
> from requirement to know other app's absolute path to do fork() && exec().
> Except that I believe using of "name" should be more secure.
>

>From a technical perspective, I do fully agree with you. But I think
that it is way more flexible for an application to be able to say:

  url_handler(http://www.ubuntu.com) -> browser
  url_hanlder(device://camera/take_picture) -> default camera app

That would result in invoking the respective applications, too, in the
correct confined environment.

> An application to be spawned doesn't need to know any "names", if it is not
> supposed to spawn anything in its turn.
>

That is where I do disagree, an application should know about URLs (or
interfaces) that it wants to use. x-callback is a really good example
illustrating the clean and flexible URL handling model as opposed to
invoking by name. At any rate, a fallback might be:

  app://com.ubuntu.camera/take_picture


> Applications do not have to assume other app's availability, they must have
> a possibility to check that.
> Pseudo-code:
>     if (isInstalled("com.google.chrome"))
>         spawn("com.google.chrome")
>
> I am not sure what dependencies you are talking about, but I can't imagine
> what else Ubuntu would have to do except managing of a table of the installed
> apps with apps' name=>path correspondence:
> "com.google.chrome" => /path-to-container/chrome
>

Ubuntu obviously would know about this mapping, but an app depending
on a specific other application for certain functionality results in
tight coupling of these two applications from my pov. The URL handling
approach pointing to specific functionality as opposed to specific
apps should solve all of the cross-app use-cases and still prevent
from tight coupling.

> Another example when one application can easily know other app's name is
> software developed by one company:
> - com.mozilla.firefox, com.mozilla.thunderbird, etc.
> - com.libreoffice.writer, com.libreoffice.calc, etc.
> Why LibreOffice suite may not know names of its bundled apps and hasn't an
> ability to spawn them? I assume here that every application is placed in its own
> confinement.

Obviously, something like libreoffice can know about its subcomponent
(see the fallback I presented before).
Another way of handling this might be that an app from a certain
top-level domain can directly invoke apps that live under the same
domain.

Thomas


Follow ups

References