Seaside in PHP (Phaux)
Moderator: General Moderators
Seaside in PHP (Phaux)
Hi all,
I spent a number of years doing Smalltalk/Seaside development but I have done a number of large projects in PHP. One of the most interesting web frameworks I have seen or used in years is Seaside (http://seaside.st). One of it's greatest strengths, Smalltalk, puts it at a bit of a disadvantage. There are a whole lot more programmers that are comfortable with PHP and have neither the interest or fortitude to learn Smalltalk.
I decided to implement much of Seaside's functionality and more importantly style in PHP. It started out more as a proof of concept but ended up being very functional. While is lacks some of the "wow neato" features of Seaside (namely continuations) both Seaside's and Phaux's approach are similar.
I am looking for feedback on Phaux. The documentation is very sparse but there has been some discussion on the mailing list. I am mostly curious about what you all (PHP developers) think of the approach.
Check it out, use/abuse the code (it's under an MIT license), and have fun.
Thanks
Will
I spent a number of years doing Smalltalk/Seaside development but I have done a number of large projects in PHP. One of the most interesting web frameworks I have seen or used in years is Seaside (http://seaside.st). One of it's greatest strengths, Smalltalk, puts it at a bit of a disadvantage. There are a whole lot more programmers that are comfortable with PHP and have neither the interest or fortitude to learn Smalltalk.
I decided to implement much of Seaside's functionality and more importantly style in PHP. It started out more as a proof of concept but ended up being very functional. While is lacks some of the "wow neato" features of Seaside (namely continuations) both Seaside's and Phaux's approach are similar.
I am looking for feedback on Phaux. The documentation is very sparse but there has been some discussion on the mailing list. I am mostly curious about what you all (PHP developers) think of the approach.
Check it out, use/abuse the code (it's under an MIT license), and have fun.
Thanks
Will
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Absolutely, I should of posted an example above. WHCounter is a very simple application that displays an number and allows the user to increment/deincrement a number with a click of a link. WHFormTest is an example of how Phaux handles forms.A little example application would be helpful as there is a good amount of code there
Notice how in both examples url parameters are not specified. Phaux handles that for you and keeps your object completely encapsulated.
This is somewhat intentional I chose a more Smalltalk like style (as much as one can with a brackety language like PHP).all named in a very un-PHP fashion
In this context neither am II am really not clear on the difference between callback and dispatch.
In WHCounter notice
Code: Select all
$html->anchor()->callback($this,"add")->with("++")I am sorry to hear that. Phaux's biggest problem at the moment is lack of documentation. Phaux does things differently in compared to most (all?) PHP frameworks and because of this it is in desperate need of documentation. I tend to think the code a clean, well factored, and reasonable. But that is mostly because I wrote itgeneral comment after looking through the code is -- Ugh.
If you don't mind I would ask you to browse through the Phaux-test directory and get another feel for Phaux. Give it a moment to sink in.
-Will
Another note on Phaux.
One of the things I am trying to showcase is PHP5's (Phaux needs at least 5.2) object model. It is tremendously more powerful that PHP4's. In some ways more powerful than Java and C++ (PHP5 fully supports polymorphism). I did not want to inherent a PHP4 coding style in Phaux in an attempt to showcase the power of PHP5.
Now if PHP only had code blocks.
-Will
Now if PHP only had code blocks.
-Will
- kyberfabrikken
- Forum Commoner
- Posts: 84
- Joined: Tue Jul 20, 2004 10:27 am
Quite interesting. I don't like the base premise of a stateful framework - HTTP is stateless, and so should HTTP applications. I went through the google-group, and I noted that you mention that the statefulness of Phaux is the main feature, and that you haven't seen something like this in other frameworks for PHP. I don't have any working experience with PRADO, but isn't that exactly what it is about?
The code examples you've given are interesting, but unfortunately do nothing to wow me and look somewhat long-winded. It's a front-controller, all right, but what makes Phaux (which is a curious choice for a name as it's very close to "faux" (fault) in French) so powerful and great?
How does it do things differently to most frameworks? Statefulness is great, how is it handled - Sessions & DB?
To me, Phaux appears to try be too all-encompassing. When it comes to frameworks, it's a bit like cooking to me. I don't like the taste of ready-made meals, give me the right tools to cook a great meal and I would use allow me to improvise, create and play at every level - in short, a developer's minimalist framework. The golden example of this is still Voostind's Eclipse: http://sourceforge.net/projects/eclipselib/ It's a bit dated now (doesn't work with PHP5), but the concept behind it is exactly my taste & I like cooking with it.
How does it do things differently to most frameworks? Statefulness is great, how is it handled - Sessions & DB?
That sounds like your trying to build a "press-this-button-to-build-your-application" framework - which I think you should be much clearer about.Phaux website wrote:REServe object relational mapper provides automatic database table creation and migration. REServe and Phaux work together to provided rapid prototyping of web applications with no code generation.
To me, Phaux appears to try be too all-encompassing. When it comes to frameworks, it's a bit like cooking to me. I don't like the taste of ready-made meals, give me the right tools to cook a great meal and I would use allow me to improvise, create and play at every level - in short, a developer's minimalist framework. The golden example of this is still Voostind's Eclipse: http://sourceforge.net/projects/eclipselib/ It's a bit dated now (doesn't work with PHP5), but the concept behind it is exactly my taste & I like cooking with it.
- kyberfabrikken
- Forum Commoner
- Posts: 84
- Joined: Tue Jul 20, 2004 10:27 am
I disagree.Jenk wrote:If you were to change your mind about that, much, much more powerful applications come to light.kyberfabrikken wrote:Quite interesting. I don't like the base premise of a stateful framework - HTTP is stateless, and so should HTTP applications.
Mind you, I realise that some things are better handled with server side state, but they are practical workarounds; I think it's a sane strategy to avoid server side state as far as possible. Using a framework which encourages the opposite is dangerous from my POV.
We don't write programs in Assembler because doing most things would be to much trouble. I don't have any problems with abstractions. On some level most web applications are stateful, persisting data in a database and managing session keys.kyberfabrikken wrote:Quite interesting. I don't like the base premise of a stateful framework - HTTP is stateless, and so should HTTP applications.
PRADO uses templates. Phaux uses programatic code generation relying heavily on CSS for layout. PRODO's state must be handled explicitly by the programer. In Phaux state is implicit.kyberfabrikken wrote: I went through the google-group, and I noted that you mention that the statefulness of Phaux is the main feature, and that you haven't seen something like this in other frameworks for PHP. I don't have any working experience with PRADO, but isn't that exactly what it is about?
"Dangerous"? Could you expand on that a bit more?kyberfabrikken wrote: Mind you, I realise that some things are better handled with server side state, but they are practical workarounds; I think it's a sane strategy to avoid server side state as far as possible. Using a framework which encourages the opposite is dangerous from my POV.
Maintaining state is something all web programmers spend a lot of time doing. Phaux just makes it much easier. Phaux, because of it's component architecture, also makes reusability much easier. Not explicitly dealing with GET/POST vars has some huge advantages. Check out WHNavigationTest. WHNavigationTest embeds the WHNavigation component and instructs the WHNavagation component to embed seven other components.
Sessions. Larger applications would have to use something like tempfs to store the session data. The performance of large amounts of data in a session was one of the biggest surprises for me. PHP handles un/serializing faster than I expected.patrikG wrote: How does it do things differently to most frameworks? Statefulness is great, how is it handled - Sessions & DB?
No in fact just the opposite. REServe allows you to treat a relational database like an object oriented one. REServe uses a follow reference approach to locating data not a relational one.patrikG wrote: That sounds like your trying to build a "press-this-button-to-build-your-application" framework - which I think you should be much clearer about
I built a number of classes that examine your object model and give you forms to handle that object model, similar to scaffolding but you can change just what you need. This is an area that needs some more work but the ideas are something I would like to explore further.
- kyberfabrikken
- Forum Commoner
- Posts: 84
- Joined: Tue Jul 20, 2004 10:27 am
That's not my point. It isn't the abstraction I find troubling. It's the strategy of storing application state at the server. I distinguish between two types of state: Application (session) state and Resource state. The former should - as far as practical - be stored at the client, and transferred with each request. The latter will be stored in the database, or what ever means of persistence, the application uses. By using this strategy, you gain a load of benefits.ev0l wrote: We don't write programs in Assembler because doing most things would be to much trouble. I don't have any problems with abstractions. On some level most web applications are stateful, persisting data in a database and managing session keys.
OK. I don't know PRADO that well, so I have (probably) wrongly assumed, that it worked implicitly.ev0l wrote: PRODO's state must be handled explicitly by the programer. In Phaux state is implicit.
kyberfabrikken wrote: Mind you, I realise that some things are better handled with server side state, but they are practical workarounds; I think it's a sane strategy to avoid server side state as far as possible. Using a framework which encourages the opposite is dangerous from my POV.
Dangerous may be a strong word. I meant that if the framework encourages storing application state at the server, developers will make use of the feature, and consequently, the application will end up being stateful. As I explained, I think that makes for a weaker application.ev0l wrote: "Dangerous"? Could you expand on that a bit more?
Most stateful applications are load balanced by session. If you are worried about load balancing don't. It's very easy with a stateful application.kyberfabrikken wrote:
Dangerous may be a strong word. I meant that if the framework encourages storing application state at the server, developers will make use of the feature, and consequently, the application will end up being stateful. As I explained, I think that makes for a weaker application.
I am not sure what benefits you gain by not using a stateful framework. A stateful framework can do everything a RESTful or stateless framework can do but the same is not true in reverse at least not with a lot of difficulty. That is not to say Phaux and Seaside don't have disadvantages I just don't see how they are disadvantaged.