by http://webgeektutorials.blogspot.com

Monday, September 19, 2011

Pakyow : Web framework for Ruby

Web framework Pakyow follows the MVC design pattern, but the flow is a bit different than what you might be used to. When a request is received the views are assembled first (based on the URL). If a route matches the appropriate business logic is invoked. The business logic can then manipulate the view and bind data to it.

Some Advantages :
  • In Pakyow, views define what the application will present. They are 100% HTML and no template language or special tags are needed to construct the view layer.
  • View construction begins with a root view, which usually defines the general view structure. Containers are created in the root view, which define the parts of the structure that are generated dynamically. Creating a container is as easy as adding an "id" attribute to any tag.
  • Pakyow provides several ways for the business logic of an application to easily interact with the views. In most frameworks the view logic is contained in the view itself, but Pakyow separates views and view logic. This keeps the roles for design and developer clearly defined and minimizes conflicts.
  • View construction happens before the business logic is invoked. The views can then be manipulated even easier than using a template language.
  • Data can easily be bound to its view.
  • A common task in application development is repeating a view for a data collection. Pakyow makes this easy
  • A custom view class can be created and used in cases where view logic is repeated across controllers. The view class can be tied to a specific view file.
  • When binding data to a view it's often necessary to format the data before binding. Sometimes you also need to change other attributes in addition to setting content (e.g. setting the 'href' for an anchor tag). In Pakyow this logic lives in a Binder class.
  • Pakyow makes it easy to change the action and method for a form based on the state of the object. Note this will only work if a Binder exists for the object being bound and restful routes exist for the object type.
  • Helper methods are defined in one of two modules: Pakyow::Helpers or Pakyow::GeneralHelpers. GeneralHelpers only provide information and are used in the Binder classes.
  • Error handlers can be defined for 500 and 404 errors. These handlers are created in the same context as the routes and configuration. Like routes, errors can be a controller and action, or a block.

No comments:

Post a Comment