Results 1 to 2 of 2

Thread: Source Code Generator Option for Constructors

  1. #1
    plissak is offline Registered User
    Name: Paul Lissak
    Organization: Sky Road
    Project: Analytic Services
    Join Date
    Jul 2009
    Posts
    1

    Source Code Generator Option for Constructors

    The slice2java and slice2cs source code generators create two constructors for each Slice class definition. One constructor takes no arguments while the other takes all the member variables. This isn't a problem for C#, but Java has a limit of 255 arguments in a constructor. I recommend adding an option to the source code generators to eliminate the generation of constructors that take all the member variables.

    Granted it is unlikely that you'll encounter a class definition with more than 255 member variables. Usually the classes are normalized into something more manageable. However I am working with an analytical model and those tend to be less object oriented. This model takes in over 300 parameters. My goal was to keep the Slice definitions as similar as possible to the model parameters.

    It seems like these constructors are there for only for convenience. So the generated code should work fine without the all member variable constructors.

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi Paul,

    Welcome to the forum.

    Thanks for bringing this to our attention. I'm not sure that an option to disable the "one-shot" constructors would be generally useful enough to warrant adding to the translator, but we definitely should not generate uncompilable code. We'll get this fixed for the next release.

    Regards,
    Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Overlay of Ice 2.4.1 source code kills VS addin
    By rpeters in forum Help Center
    Replies: 3
    Last Post: 07-01-2010, 03:24 AM
  2. How to find the master-slave source code
    By hisensewxz in forum Help Center
    Replies: 2
    Last Post: 09-27-2009, 04:19 AM
  3. slice2java task source code
    By xdm in forum Help Center
    Replies: 23
    Last Post: 03-09-2009, 03:21 PM
  4. Replies: 1
    Last Post: 04-28-2005, 08:55 AM
  5. shared my Slice2CppTask source code with u!
    By lanbo in forum Comments
    Replies: 1
    Last Post: 01-04-2005, 07:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •