Frameworks
Moderator: General Moderators
Re: Frameworks
I believe in general in life, especially in software, flexibility comes inversely to simplicity, some manage to control the proportions better then others, but the direction of variance is always the same. Simple stuff is and always will be less flexible. Every time a new branch in functionality is created a change in the API has to be made to set the appropriate configuration(s). Some people may favor one situation ( simplicity ) over the other ( flexibility ). I think anyone who only strive's for one of these situations is naive. It has to be a balance. I find software that KISS ( past tense = kept it simple stupid? ) is easier to use, but sometimes the simplicity can also be a problem, like when it restricts what you're able to do, like if zend didnt put file uploads and all that other "bloat" as PCspectra calls it. Honestly I dont think zend is bloated at all. Could it be better? of course, but I don't really see any "bad design". There is some stuff that could maybe be improved but I wouldn't call it "bad" at all, instead of talking trash the trash talkers could fix it or try to show them up as arborint is working on.
Re: Frameworks
so... arborint is a trash talker?the trash talkers could fix it or try to show them up as arborint is working on
Re: Frameworks
Naw he actually recommended Zend to me a few months ago when I was starting out, I agree with him I dont like the singletons and the multiple ways to configure the things ( mostly ), but overall Zend is a great framework.. anyone who doesn't recognize the architecting that went into it is naive. I would definitely disagree with anyone that simply said it was "bad design". If ZF is a "bad design" then show me something better you wrote, or something better in general ( that is also usable )
Re: Frameworks
So would I. Nevertheless, Zend does seem to do a lot that I don't like, such as imposing a rather tight coupling between controllers and views. One might argue that in the MVC pattern such as it is used in websites, the controller layer is actually part of the view, so the coupling might not be as bad as it is in my mind.jshpro2 wrote:I would definitely disagree with anyone that simply said it was "bad design".
Nah, the problems I've been having with Zend Framework is in it's lack in simplicity and my lack of interest and motivation of learning the framework, I think. I'm sure that most of the problems I've been having are imposed by my ignorance -- not bad design. But, when looking at other frameworks, such as Konstrukt (*1) or Symfony (*2) for that matter, I think they are easier to use. That doesn't mean they are better, that just means that they're much more appealing to me.
Some of the components that I've used in the past had API's I didn't like. For example, I've always disliked the static calls to classes such as registries and the frontcontroller. Then again, I've always disliked static calls, period. I also dislike Zend_Form, because in my humble opinion writing a form shouldn't be as complicated. I spend a lot of time on forums on software development in PHP and when looking at the questions on Zend_Form, I really have my doubts about how clear the API is.
That said, I'll shoot into defence: I haven't used ZF for a long time, and even when I did I really doubt I used it the most efficient way. There probably were easier ways to accomplish what I wanted. Maybe things have improved, maybe not. Maybe I should try using it again.
I think I'll have to agree, but that is exactly the problem I've had with ZF. It's a component library, not a fullstack and interwoven framework, such as CakePHP or Symfony. To use one of ZF's components, you'll have to be familiar with it's API (of course), you'll have to construct it and you'll have to use it. To use certain functionality in Symfony for example, you'll have to know how to call a certain "convenience" method that does everything on the API that you'd have to do yourself in ZF.pytrin wrote:I think you guys are missing the point. ZF does have some bloat, but it's more a component library than a tight framework (like CakePHP).
Concluding: yes, this is all my opinion and no, ZF doesn't suffer from "bad design". In my opinion it does make simple things complicated, which I dislike. Doing a simple thing might require you to have a lot of knowledge about the underlying API, which I also dislike. Is ZF bad or poorly designed? No. Do I like it? No.
*1: I know, the ZF vs. Konstrukt is not a fair comparison, considering ZF does a hell of a lot more than Konstrukt. Nevertheless, I think Konstrukt's manual (yes, the whole three pages) are really clear, as opposed to the ZF manual.
*2: I know, the ZF vs. Symfony is not a fair comparison either, since Symfony is a fullstack, interwoven framework where ZF is based on loosely coupled components.
Re: Frameworks
How is that so? in my ZF projects, the views are the most reusable parts. Many times I create views for single repeating items (such as a table row, or a gallery item) and render them in many different other views. This regardless of the controller/action being called. How is this tight coupling?such as imposing a rather tight coupling between controllers and views
Re: Frameworks
I didn't say views (or rather templates) aren't reusable, I said there is a tight coupling between controller and view. What I meant with this, is that there's a hard coupling between Zend_Controller and Zend_View, or at least there was last time I looked. That is to say: a controllermethod always uses Zend_View and it isn't (/wasn't) easy to replace Zend_View with something else without doing something that smells "hackerish" to me. If I don't want to use phtml files (why .phtml btw? Because RoR has rhtml?) or if I don't want to use the default Zend_View, or if I don't want to return a HTML response, things got ugly.pytrin wrote:in my ZF projects, the views are the most reusable parts. Many times I create views for single repeating items (such as a table row, or a gallery item) and render them in many different other views. This regardless of the controller/action being called. How is this tight coupling?
Then again, the last time I've seriously used ZF is more than a year ago, so like I said before things might have improved since.
Re: Frameworks
Actually you are right, this is the default - and I agree that it is a very bad default. I turn off the viewRenderer in all of my projects, so for me this is not case. Plenty of controller actions I implement do not involve views, and some of the views are outputted outside controllers (in the models - for example as email templates).That is to say: a controllermethod always uses Zend_View and it isn't (/wasn't) easy to replace Zend_View with something else without doing something that smells "hackerish" to me.
There is some coupling between the view and the controller by definition, but it is not necessarily a "tight" one - the controller knows almost nothing about the view it renders.
Re: Frameworks
Once you start getting into sub-classing your framework, all those problems go away anyways. I agree it is daunting and there are some "bad choices" in the design, but overall I think its great. For instance symphony has a "shopping cart" object, I feel that is a "bad design choice" because in my project it would have limited the amount of abstraction I would have been able to achieve overall, in this sense I feel like ZF is better then some of the other frameworks, in certain regards.
For instance if you want your own view objects there is a method in the controller that creates the view, you can just subclass that and have it create your sub-classed view object. Kind of confusing, this is a prime candidate for dependency injection... if you like that style better you might want to look at arborint's framework.. I know I do but I also feel like his framework is missing key components, in general I try to re-evaluate why I am doing what I am doing constantly, when needed I pull pieces of other frameworks in, and when no longer needed I "fire" them
For instance if you want your own view objects there is a method in the controller that creates the view, you can just subclass that and have it create your sub-classed view object. Kind of confusing, this is a prime candidate for dependency injection... if you like that style better you might want to look at arborint's framework.. I know I do but I also feel like his framework is missing key components, in general I try to re-evaluate why I am doing what I am doing constantly, when needed I pull pieces of other frameworks in, and when no longer needed I "fire" them
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Frameworks
webaddict wrote:That is to say: a controllermethod always uses Zend_View and it isn't (/wasn't) easy to replace Zend_View with something else without doing something that smells "hackerish" to me. If I don't want to use phtml files (why .phtml btw? Because RoR has rhtml?) or if I don't want to use the default Zend_View, or if I don't want to return a HTML response, things got ugly.
I think this stems from Zend choosing to make their base components fairly full featured rather than minimal. Pytrin like many turn off the base behavior. I don't know if there still is, but there used to be a performance hit for turning viewRenderer off. Seems backwards but when the base class is complex then you have to backward engineer turning things off. That probably Zend's major flaw, but the trade-off is worth it to most people (including me).pytrin wrote:I turn off the viewRenderer in all of my projects.
Yes it is. Just waiting for you to identify themjshpro2 wrote:Kind of confusing, this is a prime candidate for dependency injection... if you like that style better you might want to look at arborint's framework.. I know I do but I also feel like his framework is missing key components,
(#10850)
Re: Frameworks
Hahha after I get this cash I'll be making tons of OS libraries.
- The_Anomaly
- Forum Contributor
- Posts: 196
- Joined: Fri Aug 08, 2008 4:56 pm
- Location: Tirana, Albania
Re: Frameworks
Forgive me for taking such a long time to get back to this thread. Christmas and stuff.jshpro2 wrote:GreatPCSpectra wrote:Now those dependencies might be needed, but in a self driven project they could be removed almost 10 fold.cram everything into one god package.
@op care to share your API and explain the advantages it has over ZF? I'd be interested in the data Mapper
I enjoy just reading these threads, as I can learn much from everyone else's experience--as I'm a relative n00b. Anyway, here was my issue with ZF--in whatever lame way I can explain it.
I had a form, that required server-side validation. Zend has a wonderful validation system, and I was really looking forward to using it in this application. The action for the form was on the same page as the form was, so that I wouldn't lose all the user's data if he made a mistake. So, let's look at the email field. The user comes along and forgets the @, making it an invalid email. When he hits submit, the same action controller is run, but this time, the conditionals find that he submitted a form and starts to process it.
When the validation failed, I wanted it to stop processing, skip the rest of the action, and just show the page with an error. This way, the POST data remains, and the form doesn't process anymore. However, for the life of me, I couldn't figure out how to manually render the view. $view->render() would not find the proper view, even though it was supposedly set somewhere in the magic done by Zend_Layout::StartMVC(). In my framework, I'd just have my validation class call $template->render(), and the action processing would stop, and we'd immediately move to the form. I couldn't do that with ZF.
I spent days looking through the documentation, and came across the exact methods I needed, but they didn't seem to render the right view, the view set by the MVC architecture.
I'm sure that there was a solution to this, but I just couldnt' find it. Id' move between the Request classes, to the Controller classes, to Layout classes, all over the place. There was an overwhelming amount of features, and I simply couldn't find what I needed.
If I implied that ZF is poorly designed, I didn't mean that. It just seemed that I needed to spend way too much time working with it, when I didn't need nearly as much of the features described in that manual. Now, to incorporate certain patterms such as their implementation of the Registry, or their Config classes, that'd be perfect. But to base the entire MVC architecture on it, I had a great deal of trouble.
- The_Anomaly
- Forum Contributor
- Posts: 196
- Joined: Fri Aug 08, 2008 4:56 pm
- Location: Tirana, Albania
Re: Frameworks
I hate to double post, but I wanted to ask an entirely different question from the topic I addressed in the former post:
What do you guys do? Do you have a framework you use for your projects? I mean, as Jsh was saying, subclassing current frameworks, but do you have a standard framework that is catered to your needs? Or do you start with something like Zend and then just use what you want, pull from others, and just change it every time?
Basically, for an MVC framework, what do you do?
EDIT: Also, what is "Arborint's framework," we keep referencing?
What do you guys do? Do you have a framework you use for your projects? I mean, as Jsh was saying, subclassing current frameworks, but do you have a standard framework that is catered to your needs? Or do you start with something like Zend and then just use what you want, pull from others, and just change it every time?
Basically, for an MVC framework, what do you do?
EDIT: Also, what is "Arborint's framework," we keep referencing?
Re: Frameworks
I use a highly customized ZF. Like jshpro said, I subclassed / composed the components I use the most into a small set of my own classes. I basically put a small buffer between zend and the application (most commonly by creating a standard base for models, which Zend does not provide), which also allows me to switch to another framework retaining the same conventions if it is required.
Re: Frameworks
Obviously this depends on the project. Some frameworks have strong points against other frameworks in certain aspects. For example, Symfony is strong when it comes to quick and safe generation of "admin interfaces" (which basically makes crud with seconds). CodeIgniters and it's decendants (such as Kohana) are strong in simplicity, which means the learning curve is almost non-existant.The_Anomaly wrote:Basically, for an MVC framework, what do you do?
This is what we mean by "Arborint's Framework".The_Anomaly wrote:EDIT: Also, what is "Arborint's framework," we keep referencing?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Frameworks
Now that sounds like an interesting framework!pytrin wrote:I use a highly customized ZF. Like jshpro said, I subclassed / composed the components I use the most into a small set of my own classes. I basically put a small buffer between zend and the application (most commonly by creating a standard base for models, which Zend does not provide), which also allows me to switch to another framework retaining the same conventions if it is required.
I think that site is out of date since the project moved to Google Code (pytrin can we change the download link?). The latest is in the repository here: http://code.google.com/p/skeleton/webaddict wrote:This is what we mean by "Arborint's Framework".
(#10850)