SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Zend Framework = Bloatware?

    In partial celebration of the ever-present "1.0" release, I just wondered on over to the Zend Framework website to download and view the latest release code (1.0 RC2). I was quite shocked while downloading to discover the package was 4.5MB?! Compressed?! Now this got me curious... I popped over to the Symfony Project website to see how big their download size was... 1.8MB. Now that's a little easier to swallow. Code Igniter? 733KB.

    I bring all this up for the purpose of discussion - what is the size threshold? Keeping in mind the developer will have to upload at least a large portion of the package contents to use the framework on a website, what is a reasonable upper limit? Has the Zend Framework become bloatware even before it's first official release?

  2. #2
    SitePoint Zealot Mau's Avatar
    Join Date
    Jan 2006
    Location
    California, USA
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Don't let appearances deceive you. Uncompressed, just Zend library is 9MB (documentation takes up a lot of space). symfony's library takes up 14.6MB with another 8.4MB for 'data'.

    I would rather have a large fast framework than a slow small framework any day. The amount of bandwidth it takes to upload the extra megs is going to be a lot less than adding another server!

  3. #3
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The ZF package is filled to the brim with documentation and other auxiliaries. Also, it's doubtful that you'd actually need to include even half of what is actually code. Sure, there's a lot of stuff, but does it hurt you if you have a few unused files resting on your server? And if you do need some of the functionality, you know it's there.

    What I'd be more worried about is the state of the actual code; it's built to be flexible, not fast.

  4. #4
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured that it was documentation and examples that was taking up a lot of the room in the distributed packages, but how much is too much? Is there such a thing?

    And this prompts another question:
    With documentation and examples so readily available online, do you need to have extensive documentation packaged with the framework? I know there are rare cases where you may not have a connection to the internet, but for web developers, internet is a lifeline. I am never without it while developing, even if I am just developing locally. Could developers be better served by lightening up the package a bit and offering most of the documentation online?

  5. #5
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > Has the Zend Framework become bloatware even before it's first official release?

    I wouldn't say the framework is bloated, yet but taking a look at it yersterday, I am left with the impression that the design has taken the same route as PEAR; By that, I mean take a look at the class methods for example... Most of them accommodate for every one, and their own personal style.

    For example, you could pass in a string... An array... An object to any given class method, and the framework will work it out for you. That to me is bad design as each class method should only expect one type and nothing more, and the route the Zend Framework has taken is that of the PEAR way of doing things.

    In the early days, I was all for the framework, but now I am in doubt to be honest with you; Another point of the framework, was to make it more accessible to everyone and to keep it simple, but that isn't the case anymore either, is it?

    How many forums have sprouted up this year in regards to this one framework? I haven't stopped counting yet myself, your milage may vary.

    > The ZF package is filled to the brim with documentation and other auxiliaries.

    You can now download the framework without the documentation, etc but it's still a sizable file compressed. Most people won't need the entire framework, but they'll still upload the whole lot, human nature being what it is
    Last edited by Dr Livingston; Jun 13, 2007 at 06:03. Reason: Clarification

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Me personally I don't care 4.5MB is chump change takes less then 5 minutes to download for me anyways so meh doesn't bother me.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The download isn't the issue, it's one of maintainability in the long run; The larger the framework, relative to it's footprint, then the more effort it takes for you to maintain it. The larger the framework, relative to it's complexity, then the more effort it takes for you to maintain it.

    If the framework caters for flexibility as Ezku suggests (I agree) then it goes to say that the framework requires more maintainance on your part, over what would be required otherwise if the framework was more robust, though less flexible in it's design, or simpler in it's complexity.

    I am of the view that a framework should have the bare minimum, just to get the job done in a standard approach; You have vastly reduced flexibility from the point of view of the user using the framework, ie Their options are more limited (fewer features) but in the same breath, they themselves, the user, have greater freedom to do what they want since they are more able to allow the framework to evolve in a manner they are more atuned to.

    Maybe the Zend Framework will slow down now that it's reaching it's milestone but I'm not so sure of that... I hope it does, as if it doesn't, it's just going to keep on growing and growing, and end up as one hell of a resource hog.

  8. #8
    SitePoint Guru
    Join Date
    Nov 2003
    Location
    Huntsville AL
    Posts
    692
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Dr Livingston View Post
    For example, you could pass in a string... An array... An object to any given class method, and the framework will work it out for you. That to me is bad design as each class method should only expect one type and nothing more, and the route the Zend Framework has taken is that of the PEAR way of doing things.
    Technically you can of course pass any type of argument to each method. Same is true for every php method ever written. However, in 99.9% of the cases the method will not work as expected if the arguments are not of the correct type. I can assure you that in Zend there are many methods which expect an object of a given type and that passing in a string will not work as desired.

    Or maybe there are two Zend frameworks out there? Thats the only reason I can think of for you to make such a statement.

  9. #9
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No... There is only the one Zend framework out there, not that I was having a go at the framework, or the developers behind it; I'm sure you're doing an excellent job of it, considering the politcs behind it.

    Though from my perspective of framework development, there are a number of classes which have class methods that expect a parameter that can be of one type or another, and that as I had said earlier is bad design.

    Do you want an example? This is from 1-0-0 RC2,

    PHP Code:
    // ...
    /**
         * Set controller directory
         *
         * Stores controller directory to pass to dispatcher. May be an array of 
         * directories or a string containing a single directory.
         *
         * @param string|array $directory Path to Zend_Controller_Action controller 
         * classes or array of such paths
         * @param  string $module Optional module name to use with string $directory
         * @return Zend_Controller_Front
         */
        
    public function setControllerDirectory($directory$module null)
        {
            
    $this->_controllerDir = array();

            if (
    is_string($directory)) {
                
    $this->addControllerDirectory($directory$module);
            } elseif (
    is_array($directory)) {
                foreach ((array) 
    $directory as $module => $path) {
                    
    $this->addControllerDirectory($path$module);
                }
            } else {
                throw new 
    Zend_Controller_Exception('Controller directory spec must be either a string or an array');
            }

            return 
    $this;
        } 
    > Same is true for every php method ever written.

    Possibly but it is preventable using type hints, is that not so? Considering that the framework is for the PHP5 platform only so there really isn't any excuse in my view; It's piss poor design and let it be done with that.

    > I can assure you that in Zend there are many methods which expect an object of a
    > given type and that passing in a string will not work as desired.

    I'm not saying that isn't the case, I know that isn't the case as I've looked over the framework since the beginning, but it isn't the case through out the entire framework which is the point I'm trying to get across, yes?

    There is a lot of inconsistentcy through out the framework, and a lot of the design ethics from what I can see, bear more than a passing resemblance of PEAR

  10. #10
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    // ...
    if (is_string($directory)) { // ... 
    Also, wouldn't an assert work better where you are validating a type of string? In which case you get a halt to script execution on the wrong type; If you want to allow the user of the framework to use an array instead of a string, then just leave it to the user to override the default functionality themselves...

    God... You don't have to bloat the -beep- framework with functionality that it [the framework] can do without, out of the box... That is just another one of my pet peeves at the moment, in regards to the current frameworks for PHP - not just Zend's framework though

  11. #11
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the example, Dr.
    Saved me from downloading 4.5MB of rubbish.

  12. #12
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What i find strange is that they somehow seem to offer just about anything.. even Yahoo and Flickr stuff yet actuall usefull stuff like pagination / scaffolding is somehow left out
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  13. #13
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With regards to the setControllerDirectory method, it seems ok to me. Want one directory, send it as a string. Want more, send them as an array. To me that is more intuitive then the alternative of sending a single directory as an array. Unless there is a better alternative of course.

    Edit: Then again they use could just call setControllerDirectory method multiple times. Ahh the things a tired mind misses.


Bookmarks

Posting Permissions

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