5 Great Things About Rails MVC layer

Everyone can learn something from looking at the Rails MVC framework. Here are some highlights

1) The model is feature rich, making it easy to data manipulation in the model. For example code is often put in the controller to determine if an object is an update or an insert. This code should live in the model; it shouldn’t pollute the controller
2) There are helpers which are only accessible in the view. So little if then statements, popup windows, and javascript generation may be tucked away with out the temptation to manipulate them before the view is rendered. Today there is too much side effect programming where a controller will generate view code.
3) RJS templates provide a mechanism for injecting javascript, while keeping it separate from the view and controller. This rocks, the javascript can live on its own manipulating the page after its rendered and it can read session data.
4) Patterns for manipulating hashes make parameter logic easy. Rails has patterns for removing empty elements from hashes and combining hashes together, then digesting the resulting hash. This gets rid of all the if/then logic to check if a parameter has a value
5) Lots of helpers. Link helpers, URL helpers, image helpers, javascript lib helpers. This ensures that all paths get a little wrapper tag. This is a life saver when developing multi-channel or multi-partner sites

One Response to “5 Great Things About Rails MVC layer”

  1. RICK Says:

    < blockquote >< a href=”http://cheaptabletsonline.com/”>CheapTabletsOnline.com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. No prescription drugs. Order drugs online< /a >…

    Buy:Actos.Accutane.Lumigan.100% Pure Okinawan Coral Calcium.Retin-A.Mega Hoodia.Prednisolone.Nexium.Human Growth Hormone.Prevacid.Valtrex.Synthroid.Petcam (Metacam) Oral Suspension.Arimidex.Zovirax.Zyban….

Leave a Reply