Framework sentiment

xiaoxiao2021-03-05  54

Now there are a lot of Framework concepts, Framework As the name is a skeleton, which is a SEMP-COMPLETE Application, Application Developer can add flesh on Framework. Naturally, Framework implements comparing generic features, but this "generic" is also limited, have not seen a Framework can be applied to any application.

Modern framework is to face the user interaction. The problem that naturally to face is to come to a user input, make a corresponding response, from the most intuitive, is a bunch of IF ... ELSE ... statement, but If ... ELSE ... The statement is too difficult to maintain, first write very long, seeing CODE to find the corresponding logic, it is difficult, modifying is even easier.

Further, you can use an array to input the user input and responses, so that the large string IF ... Else ... turned to maintain this array, naturally simplified a lot.

It is also possible to maintain an array although simplify maintenance, if you want to change, you still need to be compiled. If you take this array into a configuration file (such as XML file), Code is read by reading this configuration Dynamic acquisition, so that the maintenance work does not need to modify the compiled code. Of course, efficiency may be affected by a point.

Nowadays, many J2EE Framework, such as Structs, is this idea. It is said that there is a game development to use this way to facilitate the configuration of upgrade, recently studied MFC, the big direction, but did not go to the last step, this array is still in Code However, through C Macro cleverly simplifies the work of maintaining this array, I don't know if there will be similar structs like Structs in the new Microsoft platform.

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

New Post(0)