[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper way of connecting to apps

From: Richard Frith-Macdonald
Subject: Re: Proper way of connecting to apps
Date: Sun, 22 Jun 2003 11:54:08 +0100

On Sunday, June 22, 2003, at 11:10  am, Stefan Urbanek wrote:

On 2003-06-22 11:52:35 +0200 Richard Frith-Macdonald <address@hidden> wrote:

On Sunday, June 22, 2003, at 08:58  am, Richard Frith-Macdonald wrote:
3. [NSWorkspace -launchApplication:] does not work correctly. The method returns immediately after executing application binary, i would expect it to wait until successfull application launch, so i can connect to it immediately and start communicating with it. Now I have to create a loop where I check whether application is running.
That might be a bug as you suggest... how does OpenStep/MacOS-X do it? I thought it counted 'launch' as meaning that that it had started the new task rather than as meaning that the application had completed all its startup. It's very simple to change this of course, but we need to be sure what the correct behavior is.
Further investigation seems to be quite clear that the current implementation is correct (ie the way MacOS-X does it).

Yes, if you consider that the way MacOSX does it is the correct way. Other thing is that how would you expect it to behave.

It behaves the way MacOS-X behaves.
It behaves the way I expected it to behave.

I do not think is is reasonable to introduce incompatibilities unless MacOS-X is *OBVIOUSLY* wrong. In other words, not only must your opinion of how it should work be different from the MacOS-X version, but your opinion should be overwhelmingly agreed with by other people.

Perhaps it might be worth making the GSContactApplication() function from GSServicesManager.m public, since it
wraps the code for contacting an application already?

This is something I wanted and was asking for. I knew that there are some methods in -gui for doing the sutff and I just wanted them to be public. Thereis also a method -_connectApplication: in NSWorkspace.m, but it seems to be different from GSConnectApplication.

GSConnectApplication is good method, but it requires some NSPort and a NSDate to be passed. Would it be possible to create a simple wrapper fot that method which takes just one argument? like public gnustep extension method in NSWorkspace -listenerForApplication:(NSString *)name ?

Sure it's possible, but my vote is against doing this.
I don't believe that this would be a good extension...
Keeping APIs as small and simple as possible should be a major aim for GNUstep. Additional APIs should add really useful functionality, either useful for *lots* of people, or providing important features that can't reasonably be handled another way. This doesn't qualify.

The problem is, people work on their own code, and see a feature they want for what they happen to be doing now. Psychologically, it's hard to step back from the current work and look at whether the feature will be used. Over the past few years I have removed a *lot* of non-standard stuff from the base library (some things that I added myself in earlier days) as it became clear that nobody was using it and it was just confusing newbies.

The code to handle launching and connecting to an application is pretty simple really, and very few applications ever need to use it ... so adding a public convenience method to do it is IMO a bad thing. Also, I think that most inter-application communications can (and probably should) be done using services rather than direct messaging, so that services provided by applications are advertised to other applications in a uniform manner ... direct messaging is a pretty special case for closely cooperating apps which can't use the standard services mechanism for some reason.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]