discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Missing interface that connects NSCoder to NSStream ?


From: Helge Hess
Subject: Re: Missing interface that connects NSCoder to NSStream ?
Date: Thu, 15 Mar 2007 00:54:55 +0100

On Mar 14, 2007, at 22:27, Vaisburd, Haim wrote:
But imagine a different model

All your explanation of your environment is nice, but you fail to explain whats wrong with using the existing approach. Which means reusing already available and tested infrastructure with no additional work. You focus on whats great about doing everything from scratch instead of what doesn't work for you with the already available stuff.

Eg why do you care about "The parsing is easier", thats completely irrelevant given that the parser has already been implemented, plenty of times. You need to contrast
a) not having to write a parser at all
with
b) having to write a simple parser
And a) obviously wins, especially given that the implementations are 5 + years old in comparison to from-scratch code which needs to mature.


You seem to be focused on going "your" way, despite the fact that even JSON-RPC spec dropped that approach. And sure, implementing JSON- RPC won't be too hard. Now thats your choice and I won't attempt to convince you, but you can't really expect "best practice" advise or framework support for doing things the "wrong way" :-)

Given your background I would choose between two options, either:
a) if speed is a concern, I would use a binary protocol on a socket,
   possibly using shared-memory instead of sockets (you said local IO)
b) if its fast enough, I would use XML-RPC
JSON-over-streams seems to make no sense for your setup in any case, since its also slow and its not an accepted standard either.

Anyways, I've even pointed you to a toolkit which enhances GNUstep with the streaming functionality you want.


I was very confused not seeing the equivalent of getc()
in GNUstep.

Well, as mentioned thats because its usually not required in real world applications. And for the few cases where it is, it doesn't make sense to add generic framework support.

Either use a standard solution, an appropriate addon or write your own small extension (adding a lookahead stream on top of NSInputStream or NSFileHandle is also trivial).

Helge
--
Helge Hess
http://www.helgehess.eu/






reply via email to

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