Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize form-centered Ruby on Rails form-oriented programming

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve form-centered Ruby on Rails form-oriented programming, the article introduces in great detail, has a certain reference value, interested friends must read it!

Many characteristics of enterprise development determine its often database-centered development model. However, this article is about the form-centric development model, which brings a lot of inspiration. Form-oriented programming in Ruby on Rails is used in this article, but the basic idea should be universal.

People who have done enterprise development in China know that domestic enterprise development is often more business and short time, which is a common phenomenon, so software development companies are also pursuing the method of rapid enterprise development. When many development companies do enterprise projects, requirements personnel communicate with customers, build database tables after understanding the requirements (PowerDesigner is the king in this field, I believe many people have used it), and then give the requirements documents and databases to developers (of course, some requirements personnel do not build tables, developers build tables are also common), developers gradually achieve the requirements. If the requirements change in the future, modify the database first, and then modify the upper interface of the program.

This development model takes the database as the center, and all the upper development revolves around the database, which is the bridge between the demand side and the development side. I believe that many domestic companies have adopted this development model, and perhaps the company where the readers are reading this article is also the same, right?

Of course, the experience I want to introduce in this article today is not a database-centric development model, but what I think is a more advanced form-centric development model. Of course, this is also my practical work experience. Take a look at this example:

When we are doing a management project, the user gives us the above Excel file to let us implement the business. At this time, the requirements are very clear and the company can carry out development.

If it is the previous database-centric development model, the software company requirements personnel need to build tables first, according to the Excel file, add fields one by one. Then the Excel file and the database table are given to the developer. The developer needs to make the software input interface according to the Excel file, and then correspond the input field to the field of the database table one by one. It will take at least a day to get the above things done, even with a skilled team. If the user proposes at this time that the form needs to be accurately printed and ready to be stamped and archived at any time, then the developer will have a lot more work.

Form-centered development model, do not model the database, but the form modeling, using special form modeling tools, similar to Excel, copy the user's Excel file into a model, export to XML format file, after these XML files are the core that we need to maintain. There are some mature form modelers on the market, such as Yuyou's Cell component and other companies' reporting software. Our company has independently developed a set of tools (not for sale), which can be used for form-oriented programming. So how does form-oriented programming address the needs raised by the users above?

After the user gives us an Excel file, we use the modeling tool to make a similar form (faster if the tool itself supports Excel replication), save the form as a XML file and publish it to the program framework, and the framework program automatically builds the table and adds fields after analyzing the XML file. The program framework encapsulates the routine operations such as reading, writing, deleting, printing and so on. The only place where the upper layer needs to write code is the list display function. Use a Sql statement to find out the form records that need to be displayed, and pick out the fields that need to be displayed in the list. Using this model, the requirements put forward by the above users can be easily solved in less than 20 minutes. This is one of the interfaces after the final completion:

In addition to implementing the above interface, you can also achieve more advanced functions, such as client-side verification and operations to ensure that a cell must be filled in, or that the value of a cell must be greater than a certain value. or several cells must guarantee the relationship of addition and product. You don't have to write code for these features, just use the built-in features of the form designer. This model can achieve the separation of technology and business. Let people focus on the business and forget the technology. In fact, if you are still considering how to implement the user's needs in the process of developing the project, there is no doubt that the project is very dangerous.

The following is the interface when the form modeling tool is designed:

In form-oriented programming, most of the changes in requirements in the future focus on the format and flow of the form (because the form carries the user's daily business). We just need to adjust the form and republish it, and it doesn't involve modifying the code. The same is true when the process has changed, and the workflow file can be reissued after modification. I think most software companies have their own ready-made framework to implement general functions such as users and permissions in advance when they do projects. The form-based development model also requires the software framework to do a lot of things, but also requires the cooperation of independent form designers, the amount of development on the framework is relatively large. But when the accumulation on the framework is very stable and perfect. It is very happy to use the framework to do the user's business. With the rapid development of form-based development mode and ROR, coupled with the support of report query engine and workflow engine, the development of enterprise applications will be like a rocket. Working on a project in that state will no longer follow the user's lead, but will do it faster than the user says, and will be able to lead the user by the nose. At that time, the development progress will be well mastered, the customer relationship will be well maintained, and it will not be difficult to get the project money back. If you want to know more about form-oriented programming, you can refer to U8 and other financial software, which is full of tables, which is really thoroughly form-oriented programming, and other technologies of Uyou software are relatively weak, and the interface is very simple. It can almost be said to be a move all over the world.

These are all the contents of the article "how to implement form-centric Ruby on Rails form-oriented programming". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report