Multi-layer development framework for components based on webmobilewindoSUNIX platform

zhaozj2021-02-16  91

Hello everyone!

I usually use the Delphi ELP program, for security and efficiency, in the last few months in learning J2EE, perhaps Delphi is used to us, I always feel that Java is good, it is too cumbersome, not in line with "development people-oriented" "idea. Here is an ideal ERP development framework based on my needs, can you make an opinion on this framework, see if it is feasible?

Because I have limited levels of programming, I can only say that there is a matter of probably, but I believe there are many masters to understand what I mean:

1. This framework consists of three elements: components, SQL, an object-oriented language for server-side (can be Java, C #, C , ObjPascal, or an intermediate language).

2. The core is the component, similar to the TFORM, TEDIT, TLABEL, TIMAGE, TDBGRID components, etc. in Delphi, and one component is composed of a main layer of the representation layer and the server running on the client, and the representation layer can be written in different languages. Running the web, windows, linux, mobile phones, etc. For example, the same TDBGRID component, in the Windows window environment, a table control with a summary, sort, export, and print function, and a web form with similar functions but expressed as automatic paging display in a web environment, In the mobile phone environment, only the list of texts with roll bar.

3. The program body is running on the server side, the server container implements the target pool, connecting pool, thread management, SQL optimization (if possible, automatically compiled into a stored procedure corresponding to the local database), the client runs only the component of the component, for The customer's information input and output, the client is equivalent to a image of the server side, for example, the server side generates a window object, the client will pop up a window, and the server-side window object is dynamically generated to generate a button object, the client's window A button will also appear.

4. Programmers use only for component programming, abandon the maintenance of the representation of the details, and can realize the artwork and programmers who do not understand the programming really separate. For example: There is a main window in the program, one hundred determined pop-up windows, and several uncertain windows (window types, and their subcompons are dynamically generated during the running period, can't be determined in the form of drag and drop in IDE), this In the case, you can beautify each of the determined forms for each determined form, a format file similar to CSS is generated, such as:

Form1

In the Windows window environment: shape = rounded square (width = 600; high = 400); window base color = gray; title bar = blue

LINUX window environment: shape = square (width = default; high = default); window base color = gray; title bar = red

In the browser: shape = round; title bar = no; flower side = lace 1.jpg; pop-up sound effect = scared, jump. WAV; effect = fade out

In the phone: shape = container with up and down roller

Menu1

In the Windows window environment: background color = dark gray; icon = ico1.ico, ico2.ico ...

LINUX window environment: Take default

In the browser: style = custom menu 1. style

Mobile phone: shape = Scroll menu item

Button1

Windows window environment: shape = standard button (TOP = 10; left = 10; width = 100; high = 50); background color = gray; icon = button icon 1.BMP

LINUX window environment: shape = elliptic style (TOP = default; left = default; width = default; high = default); background color = gray; icon = no;

In the browser: shape = animation button style 1, position = default

On the phone: shape = text menu

..... 下 下 .....

As for the dynamically generated window, menu and other components, there are two types: 1 is to maintain 2 by programmers 2 is to take the default CSS style 5. Directly use the SQL operation database, do not make OR mapping (for small business programmers, Learn to SQL is very good, then learn what OR is a bit strong, they want to learn fast and functional quick ways),

In order to improve the speed of the SQL statement, I put a way: first write the structure of the database in the electronic form such as Excel, there is the following benefits:

1) .Excel table facilitates writing documents in the future, (actually you have to write);

2). Available tools (I have already compiled) directly to create an empty database according to the Excel table and plus various keys and constraints. And you can write Create Table Child (ID INT NULL AUTO_INCREMERY KEY, Name varchar (100)) is much more statements.

3). When programming, put the Excel fragment to the program, write the insert, update statement, speed up the programming speed (see below),

4) 省 中 中 写 写 中 注 中

5). You can use Excel to generate a SQL query statement. You can display the contents of the database in DBGRID without having to lose one letter in the keyboard. (Because the method is limited here)

It is best to support embedded "Excel table" format in the IDE, why do you say this? You will understand the routine from PU_INSERT to CD_TMP.First to understand: it is aligned in Excel, because it is originally sticking directly from Excel.

The following is an example of a shipping process with Delphi language:

String1: = cd_order.xmldata; // Save the data of the server-side order primary table

Public_begintrans_repeatable; // Call SQL Start Transaction, Controlling Transaction Level to REPEATABLE

Try

View_reflash; // Refresh Order Home Table Server End View

IF (cd_order.xmldata <> string1) Then Raise ematherror.create ('action failed: The current order content has been changed by other people, please check the order');

IF PU_GETONESTRING ('SELECT FHDCODE FROM FHD WHERE FID =' Factid 'and fhdcode =' # 39 cxbuttonedit1.text # 39)

<> '' Ten Raise ematherror.create ('error: The shipping form of the same number already exists!');

PU_INSERT ('fHD', [// write delivery order into the database

'FID INTEGER factory code' FactID

'FHDCode Varchar 20 document number' cxbuttonedit1.text

'ORDERNO VARCHAR 20 must fill the order number' cxtextedit3.text

'FHDDATE dateTime required Date' PU_Today

'Remark Varchar 200 Remarks' CXTextEdit6.Text

'Car varchar 10 Team Code' cxtextedit1.text

'Receiverman VARCHAR 10 consignee' cxtextedit5.text

'Deliverto Varchar 80 Dedicates' cxtextedit2.text

]);

CD_TMP.FIRST;

While Not (CD_TMP.EOF) Do // The model to be shipped is in CD_TMP

Begin

PU_EXEC ('Update STKCRD SET Qty = Qty -' CD_TMP.FieldByname ('delivery quantity') .sstring

'where fid =' _ factid 'and modle =' # 39 cd_tmp.fieldbyname ('finished model') .sstring # 39); // Change the current inventory

CD_TMP.NEXT;

END;

(...

PU_COMMIT;

View_reflash_both; // Simultaneously refresh the server and the client view

Tell ('delivery is successful, shipping number: "' cxbuttonedit1.text '");

if iftell ('is now printing the shipping order?') Then Sale_Printfhd (cxbuttonedit1.text);

cxbuttonedit1.clear;

Except

ON E: Ematherror Do Begin Pu_rollback; Tell (E.MESSAGE) END

Else Begin Pu_Rollback; Tell ('program unknown error, please contact the system administrator') End;

IF debug life.

end

// Description: PU_INSERT (...) is running after actually compiling, "INSERT FHD (FID, FHDCODE ...) VALUES (1, 'XXXXXX', ...)" standard SQL statement is running, that is, Said that the middle "VARCHAR 10 consignee" is equivalent to the annotation, increasing the readability of the program.

6. Do not distinguish between MVC hierarchy and simplify the development process. From the above code, everyone can see that the above code is a code that is not a MVC in a typical C / S mode. But MVC does not have a good side: the code is simple. What is the original intention of MVC? One of the original intentions is fear that the business logic is tampered with in the V layer. Because the V layer is only an integral part of the component, the body is running on the server, so it is impossible to tamper, so it is directly for the V layer (component layer) The layer is no longer a shortcoming, it is its advantage. It saves the communication between the two development layers of the C layer and the V layer. The second of the MVC is that the layers are mixed with the logic layer to be unfavorable to maintain, but this architecture Because of the writing of the component representation, it is completely abandoned, and it is very convenient to maintain the programmer if there is a programmer to write HTML, and the art must write Java scripts. It is very convenient. Furthermore, for small businesses, there is generally no problem to be reused. If you don't reuse, you will write your business logic in a public process.

7. Unless there is printing, export client requirements, its data processing is on the server side. For example, a set form has 10,000 records. For each screen, the server side takes 20 records from the database to the server-side and client displayed at the DBGRID component, and the response speed is very fast. It is a bit like Delphi's MIDAS technology, but it is more likely to understand than MIDAS.

8. Security: Fully built on the component, each component design must ensure that there is no security vulnerability, Ning contact for forever. 9. Running efficiency: No A J2EE or .NET, directly utilize J2EE or .NET to implement server-side containers, if the pursuit of efficiency is not high, the server side can implement the original life code component container.

10. There is an integrated IDE that supports component drag and drop, supports compilation debugging within IDE, no ANT support.

11. Easy to install, once the installation ensures success, no need to handle what environment variables.

12. The difference between the framework and other similar technologies:

The framework is different from TapeStry: TapeStry can only develop web, only Java can only be used, and this architecture can be used to run everywhere, supporting various languages.

The difference between the framework and the .NET framework: .NET must be developed separately for web and window environments, and lock in the Windows environment.

The Flex differs from Macromedia is that Flex focuses on the representation of XML representation, separating the C layer with the V layer, and can only be used for Flash controls.

The difference from Microsoft XAML: XAML focuses on the representation, separated the C layer with the V layer, and can only be used for the longhorn platform.

Difference to XUL in Mozilla: XUL focuses on the representation, separated the C layer with the V layer and can only be used for the Mozilla browser.

Difference to WebWork: WebWork is locked in the Web development of the Java platform.

13. This framework disadvantage: 1) The program cannot use the API call to the platform (for the ERP program is not very affected) 2) Because of the direct database and interface operation, modifying the enterprise logic is very convenient, what is it, immediately It can be implemented in the code in the code, so that I have a flow chart I have now painted (I haven't found a suitable modeling method now) can't keep the speed of my modification of the code (I now compiled the CS structure ERP program) The whole program is like a bunch of noodles. However, there is a little affirmation, I have been using a flow chart when I am programped and communicated, and I don't need any UML map. For a small company that is often unclear, it is not necessary to pack, more than this In fact, each table in RMDB is a natural object.

I don't know how to see this framework, anyway, it is the ideal I want to apply for the ERP development tool for SMEs: the learning cycle is short (no need to learn JSP, servlet, HTML, .NET, FLASH, ANT, Struts, Hibernate, etc., as long as you learn more than a dozen components can be used), the development speed is fast, the security is good, support high concurrent visits, and write it everywhere (as long as the client can implement the representation of the component).

Exterior: I think the rapid prototype development method is very practical. It does not require programmers to learn deeply to enterprise expertise. The ideal development schedule should be like this: development time ≈ Time to obtain demand. I don't understand why I can spend more than two hours to spend a month time to develop? If the customer puts a unclear demand within two hours, we will give him a rough running prototype after two hours. Anyway, the procedure is changed, and it is not a change to cover the house. Customers don't feel good, he will tell you how to change. If the customer gives you a very detailed requirement within a month, it is estimated that you can take at least one month to make a program. The program is a customer and programmer collaboration. If you collaborate for a few months, the customer understands what he is really demand, but it is difficult to achieve the programmer (the customer suddenly asks the programmer to run 100 meters in 8 seconds), this The situation is very troublesome. If you want to have money to take it, no money, these months will be white, to avoid this, only two ways: one way is to collect money according to cooperation (current seems No software company cattle to this point), another way is to train customers before cooperation, let me listen to him, let him know that "the program is cooperation" this basic truth, tell him cooperation During the period, it will be a fatal to the development cost and progress to the development cost and progress to ensure that the programmer will make some kind of compensation even if it is destroyed. Another problem is: If the customer is really not wrong, he does say that it is necessary to run 100 meters in 8 seconds, but the programmer understands for 80 seconds to run 100 meters, what should I do? Nothing to do, I have a good time, It is impossible to avoid errors, but the way to reduce the loss is that if the development speed is very fast, it is going to work for a month. Three days will finish, it is equivalent to less lost 27 days, here Reflecting the importance of development speed comes, in short, the final goal of the framework I understand is "accelerating the development speed." Figure of the framework:

转载请注明原文地址:https://www.9cbs.com/read-12012.html

New Post(0)