zeromq / zproto

A protocol framework for ZeroMQ
MIT License
237 stars 100 forks source link

Add another codec to project #89

Closed mvala closed 10 years ago

mvala commented 10 years ago

Can we have script, probably gsl script to generate another zxxx_msg in case user need 2 or more codecs?

If we will have such script. User can use zproto to generate simple generic zXXX project without zXXX_msg and later on one can append codec when needed.

mvala commented 10 years ago

or maybe to have xml file like https://github.com/zeromq/czmq/blob/master/model/project.xml for codecs

hintjens commented 10 years ago

I'm not sure I understand the problem. Could you explain that (the problem)?

On Wed, Jul 16, 2014 at 9:48 PM, Martin Vala notifications@github.com wrote:

or maybe to have xml file like https://github.com/zeromq/czmq/blob/master/model/project.xml

— Reply to this email directly or view it on GitHub https://github.com/zeromq/zproto/issues/89#issuecomment-49216996.

mvala commented 10 years ago

Problem 1: For example, i would like to create zXXX project (with directory sctructure zproto, czmq, zyre like) and i don't want to create any zXXX_msg yet. I want to have just generic project. In current zproto, i would use

scripts/create_project.sh

and i would remove zXXX_msg.h, zXXX_msg.c, ... and remove strings from autotools configuration

Problem 2: In my project i would like to have 2 codecs, zXXX_type1_msg and zXXX_type2_msg. And again, i would have to do it by hand to add another zXXX_type2_msg.

So approach, which czmq is doing i like very much because you add entry in model/project.xml class and autotools confiuration will be generated for you

## Option 0 - Adding a New Class

1. Add your new class to the src and include directories, edit czmq.h and
   czmq_selftest.c, and make a pull request.

I above example you have to put your header/implementation file to include/src dirs, but it zproto case one would just create myproj_msg.xml and everything (autotool config and header/implementation file) would be configured for him.

Is it clear now?

mvala commented 10 years ago

Proposal is to have script to generate simple generic project via

scripts/create_project.sh

and to have script

scripts/add_codec.sh <path to  myproj_user_msg.xml>

which would initialize/generate myproj_user_msg.h and myproj_user_msg.c and append correct autotool configuration

hintjens commented 10 years ago

OK, so the focus here is creating new projects with arbitrary structure, which may include generated classes, or not.

What we put into zproto/skeleton is useful, but incomplete. What I like about it is that it creates the directory structure and LICENSE and so on. However the makefile generation we have in CZMQ/model is more powerful.

How about we split this off to zeromq/zproject, taking the model generators from CZMQ and adapting them? We can then use them in CZMQ, Zyre, zproto, zmon, etc.

I'd keep the same structure as zproto, so zproject/skeleton with the template, and zproject/src with code generation scripts. Thus the user builds and installs zproject -> /usr/local/bin and can then create more projects.

-Pieter

On Jul 17, 2014 6:02 AM, "Martin Vala" notifications@github.com wrote:

Problem 1: For example, i would like to create zXXX project (with directory sctructure zproto, czmq, zyre like) and i don't want to create any zXXX_msg yet. I want to have just generic project. In current zproto, i would use

scripts/create_project.sh

and i would remove zXXX_msg.h, zXXX_msg.c, ... and remove strings from autotools configuration

Problem 2: In my project i would like to have 2 codecs, zXXX_type1_msg and zXXX_type2_msg. And again, i would have to do it by hand to add another zXXX_type2_msg.

So approach, which czmq is doing i like very much because you add entry in model/project.xml class and autotools confiuration will be generated for you

Option 0 - Adding a New Class

  1. Add your new class to the src and include directories, edit czmq.h and czmq_selftest.c, and make a pull request.

I above example you have to put your header/implementation file to include/src dirs, but it zproto case one would just create myproj_msg.xml and everything (autotool config and header/implementation file) would be configured for him.

Is it clear now?

— Reply to this email directly or view it on GitHub.

mvala commented 10 years ago

i think that zproject is the one i was looking for. :)

sappo commented 10 years ago

The project skeleton always felt a bit like a second class citizen in this project. I like this :+1:

hintjens commented 10 years ago

OK, Martin, do you want to start then?

On Thu, Jul 17, 2014 at 10:17 AM, Kevin Sapper notifications@github.com wrote:

The project skeleton always felt a bit like a second class citizen in this project. I like this [image: :+1:]

— Reply to this email directly or view it on GitHub https://github.com/zeromq/zproto/issues/89#issuecomment-49271414.

mvala commented 10 years ago

:) I can work on it on Monday. :)

hintjens commented 10 years ago

Great :-)

On Thu, Jul 17, 2014 at 1:00 PM, Martin Vala notifications@github.com wrote:

:) I can work on it on Monday. :)

— Reply to this email directly or view it on GitHub https://github.com/zeromq/zproto/issues/89#issuecomment-49292475.

mvala commented 10 years ago

I have it on my todo list, but these days i am busy with my work. I will return to this as soon as possible

hintjens commented 10 years ago

I'm closing this issue and rewriting it.