Rails framework is popular in his design philosophy

Source: Internet
Author: User
Tags grails
These two days I read a book "grails authoritative guide" and read the rails framework on java. There are two design concepts:
1. Make simple thing easy and make complex possible-make simple things easier and make the implementation of complex things possible
2. Convention over configuration -- the Convention is higher than the configuration
Rails has almost become synonymous with agile web frameworks. Community The grails, Mono rails and subsonic of the. NET open-source project, and the ASP. net mvc framework being developed by Microsoft ASP. NET team all reflect the above two design concepts.
Let's take a look at the Rails-style agile development kit in. Net:
1. MVC Framework: whether it is Castle monorail or ASP. net MVC framework is clear and concise. If you want to use these two development web frameworks, you must do it in their own way. The model file will be placed in the models directory, controller, view, helper is placed in a directory with a specific name. As long as you follow this rule, everything is very simple. If you really want to raise the bar, you may be able to achieve the goal, but you are very tired. But why do we need to follow other people's rules for development on his website? Besides, the directory structure, naming rules, and URL-to-action ing are reasonable and clear, the Asp.net MVC that will be released on mix will be greatly enhanced on URL routing, And the monorail project is also strengthening the URL routing content. It seems that it is easy to create a set of rules. Is it better to create a set of rules by yourself.
2. o/R Mapping: Orm architectures such as Nhibernate and ibatisnet all have at least one configuration file that records the or ing relationship. However, the rails framework does not. It uses scaffold to generate a model, by default, the model of the singular table name corresponds to the complex English table name, And the DB field name corresponds to the model field name. The table must have an integer field called ID as the key and other intuitive conventions. In this way, developers do not need to maintain a large or mapping configuration for the flexibility that may exist. This is easy. Subsonic project and Castle's activerecord sub-project, because. net static language is not as flexible as ror in the Implementation of Dynamic Features, it is based on.. Net attribute to identify the field and relationship. Subsonic does not execute reflection-based ing at runtime, but directly generates and compiles the data access layer. Their design patterns are activerecord. activerecord is very simple for crud. Each object can have its own fetch and fetchbyxxx methods. From the developer's perspective, they know how to load and save themselves, objects themselves to maintain isdirty and other identifiers. Developers do not have to worry about whether the object should be inserted or updated.
3. Ajax. In the past few years, a Web framework must support Ajax. Many examples of Ajax support by the Asp.net MVC Framework are provided by jquery. Monorail uses the prototype library by default. The monorail team is supporting other JavaScript frameworks. For details, see jquery and monorail.
4. Loger: For a web application, log is very common. The castle framework and spring.net and Ms enterprise libraries both have log and a more common log library. For more information, see common logs.
5. mails: For a web application, log is very common. The support in the castle framework is comprehensive, from the mail template to the mail sending encapsulation, etc.
6. Job Scheduling: It is indispensable for a Web application to use Job Scheduling to complete some system maintenance and report generation functions, there is also a general project supporting the open-source job scheduling framework-quartz. net
7. IOC container: Microsoft is also engaged in IOC, which is called Unity. A brother in the garden introduced it. For details, see Dependency injection container unity Application Block (1): Quick Start. This is just a baby, and it cannot be compared with the framework developed by Castle and spring. Net for several years.
4. Dynamic Language: with the advent of DLR, dynamic language has also arrived. net, DLR now releases Alpha 8, sliverlight 2.0, and DLR will assume an important role, that is, dynamic languages such as ironpython and ironruby will officially enter our toolbox.

So many toolkit tools do not have a fully packaged framework. The most complete framework is the castle monorail framework. With the accumulation of castle over the past four years, we are still moving forward, microsoft's release of Asp.net MVC interrupts the development of the monorail project. Subsonic itself is a very powerful application Program Tool set. If used with ASP. net mvc, it will become a very useful application framework. In short, the design concept throughout ror is a good reference for us to use. Net for development.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.