[zeromq-dev] HEADS UP: changes to Java binding public API

gonzalo diethelm gdiethelm at dcv.cl
Fri Apr 9 00:40:35 CEST 2010


> > Now, another question. Since I would be changing the public API,
perhaps
> > this is also the moment to introduce another change:
> >
> >   import org.zeromq.ZMQ;  // NOT org.zmq.ZMQ!!!
> >   ...
> >   ZMQ.Context c = ZMQ.context(0, 0);
> >   ZMQ.Socket s = c.socket(ZMQ.PUB);
> >   ...
> >   ZMQ.Poller p = c.poller(3);
> >   ...
> 
> I am personally voting for the change!
> 
> While it may be painful (but not excruciatingly painful) for those
> already using the binding to catch up, it means that Java binding will
> have _standardised_ API, same as any other language binding. That, in
> turn, will save a lot of pain for those moving between different
> languages.

Ok, couldn't help myself and just committed the following changes. Any
comments (and complaints) are welcome.



Moved all files to the org.zeromq namespace.

Created a global namespace called ZMQ, which contains all Java classes
(Context, Socket, Poller).

Added new ways to build objects (although the constructors are still
available):

  ZMQ.Context c = ZMQ.context(1, 1, ZMQ.POLL);
  ZMQ.Socket s = c.socket(ZMQ.PUB);
  ZMQ.Poller p = c.poller(3);

-- 
Gonzalo Diethelm



----------------------------------------- 
Declaración de confidencialidad: Este Mensaje esta destinado para
el uso de la o las personas o entidades a quien ha sido dirigido y
puede contener información reservada y confidencial que no puede
ser divulgada, difundida, ni aprovechada en forma alguna. El uso no
autorizado de la información contenida en este correo podrá ser
sancionado de conformidad con la ley chilena. 
Si usted ha recibido este correo electrónico por error, le pedimos
eliminarlo junto con los archivos adjuntos y avisar inmediatamente
al remitente, respondiendo este mensaje. 

"Before printing this e-mail think if is really necesary".
Disclosure: This Message is to be used by the individual,
individuals or entities that it is addressed to and may include
private and confidential information that may not be disclosed,
made public nor used in any way at all. Unauthorized use of the
information in this electronic mail message may be subject to the
penalties set forth by Chilean law. 
If you have received this electronic mail message in error, we ask
you to destroy the message and its attached file(s) and to
immediately notify the sender by answering this message. 




More information about the zeromq-dev mailing list