in reply to Re: Re: Re: Re: Re: Re: The costs of packages
in thread The costs of packages

the volume would make this messy and difficult to manage.

This is a Straw Man, BrowserUk. At a previous job, I managed over 10,000 (initially) auto-generated classes using two scripts. It's easy, once you have the system in place. (Putting the system in place is often worth the 2-3 days it takes to get right.) Plus, I believe a responder to the initial post pointed out a CPAN solution that might get 90% of the way there ....

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re7: The costs of packages
by BrowserUk (Patriarch) on Sep 17, 2003 at 17:07 UTC

    Hmm.

    Each module consists of only the constructor. Everything else is handled by the superclass.

    If I can have one module that consists of (currently, though it's not finished) around 100 lines of executable code, and one line of data for each of the several hundred types involved, versus one superclass of 100 hundred lines and an 8 line module for each of the several hundred types, I prefer the former to the latter.

    Further more, the data lines are extracted from header files using another script. The header files are subject to changes. These are infrequent, but I'd rather just re-generate the DATA section of one module when required than fuss with maintaining several hundred, small and essentially identical modules.

    I did look at several possible candidates for doing this before I started including Class:Struct , Inline::Struct, C::Dynalib::Struct and Win32::API::Struct, but felt that none of them met my requirements for

    • Ease-of-use (of the resultant types rather than developing my module).
    • Efficiency. Both from the memory and performance stand point and also the effort required on behalf of the user coder.
    • Ease of (re-) generation.

    Basically I thought I could do better, and I do not have the commercial pressures upon me to do it in any give time frame, so I am going ahead with my design. Whether the result will meet my own requiements will take a few more days to verify.

    Whether others will consider my efforts worthwhile I won't know unless I publish the code...which I may do if I am satisfied with the result.

    I really tried to avoid this whole discussion by asking a very specific question. It's difficult to argue the merits for or against what I'm doing without getting into a full blown description of the entire project, which I'm not in a position to do right now.

    When the project is completed, I might work up a comparison between my solution and one or two of the other possibilities suggested and throw it out for discussion. It might be interesting thing to do if anyone else would be interested.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.