Eighth back string Library (continued)

Source: Internet
Author: User
Here: http://www.cnblogs.com/ixnehc/archive/2010/07/14/1777624.html

There are still some problems with the use of the string library.

 

First, all strings in the string library are in a parallel relationship without layers, which makes it inconvenient to search for a character in the string library. therefore, we need a classification method, so we introduced the "Group" concept in the string library. We can mark some strings in the string library as "groups ", indicates that this string represents a group, and then you can specify the groups to which the strings belong for other strings in the library, as shown in the following code:

 

Currently, a string can belong to multiple groups. A group can also belong to another group. As mentioned in the original article, when we need to edit the value of a string ID, we will specify a semantics for it, which consists of two parts: a pre-defined code, and a constraint string, we can pass some additional information required for editing in this constraint string. with the group concept, we can enter the group name in constraint, and the corresponding string library editing box will check this constraint, the Edit panel displays the string that belongs to this group. for example, the data structure of a button control may be as follows: Struct button { Stringid STR; // The text of the button ... ... // Object Description Begin_obj_desc (button, 1 ); Gelem_var_init (stringid, STR, stringid_invalid); // The Initialization is invalid. Gelem_editvar ("string", gvt_unsigned, Gsem (gsem_stringid, "button text ") , "Text string "); ... ... End_obj_desc (); }; (For content about object description, see http://www.cnblogs.com/ixnehc/archive/2008/09/15/1290939.html) In the editor, click... in the red box to bring up the string library editing box.

 

This makes it easier for users. Another problem is that the version of the string library is updated. A string library is saved as a file and put on sourcesafe. When anyone wants to modify it, it will go to the checkout file and then checkin after modification. however, in actual project development, the project team usually has a sourcesafe database, and the engine group also has a sourcesafe database, which should be completely separated. both the engine group and the Project Group may need to modify the string library. when the engine group wants to update the latest engine version for the project team, the problem arises. How to update the string library? There is no way to mix these two files. They are both independent binary files. It took me a lot of time to consider this issue. At one time, I wanted to divide the string library into two files for storage, but this would require a lot of modifications. Code It also becomes more complex, increasing the chance of errors.

 

Finally, I chose a relatively simple but ugly solution. All the editors maintain two sourcesafe connections, a basic connection, and an extended connection.

 

 

You do not need to set extended connections. In this case, the basic connection is used for sourcesafe control. If you have set extended connections, the string library will use this extended connection for operations, note that only the string library editing box will use this extended connection, and the other part of the editor will still use the basic connection. in practical applications, project team members do not need to set extended connections, while engine group members need to set extended connections to the database of the project team. That is to say, the engine group and project team members will share a string library. when the engine group updates the engine version to the project team, the string library is not updated.

 

This is indeed an ugly solution. In order to partition a string library, a new sourcesafe connection is added. however, this simplifies the problem and avoids the possibility of errors. it also provides some scalability. Maybe there will be something to share between the engine group and the project team in the future? So I chose this solution, and I hope it is correct.

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.