And the computer room charge system once again get along with (. NET version):

Source: Internet
Author: User

Computer room toll system personal reconstruction of the tail, that is, the overall summary of the time. Master every time the acceptance will have too much harvest, their own leaks more loopholes.

First, talk about time. Historically, the most efficient use of time, this and the teacher's guidance and supervision can not drag the relationship. The month of the final exam of the integrity professional, time to pick up a little bit of trouble, but, planning, still feel not so busy. Because before the beginning, the master gave the time, said what content how long time to complete. Every day have their own plans, to complete a few forms or how many pictures, long ago to find rice teacher talk about time management problems, only then deep experience. There is such a good teacher in the tube to study hard, if the master regardless of it is going back again. So I have to develop their own habits, plan ahead.

may be every day in a hurry to complete the completion of the content, so ignore the details, when the first time the teacher to see the appearance of a lot of details did not do. The main:

Design of the database

1, E-r Figure:

to draw strictly according to the standard of E-r chart, pay attention to the relationship between entities.

2. Conform to the three paradigms

Perhaps you would think that the Poplar version of the database has some redundancy, such as the recharge and return card form both the school number and the card number, if it is a card number of the top record, it is necessary to repeat the identification of the card holder of the school number. We can completely remove the study number, when the number of the query card is naturally identified the number of the card (in addition to a student has more than one card, I designed a student only hold a card)

3. Note the primary foreign key relationship

When the associated table deletes data, we have to consider whether the relationship is broken, when we can apply a trigger or a stored procedure.

4. Stored Procedures Angels or demons?

When it comes to complex SQL statements, there is no use of multiple triggers or stored procedures, because freshness saves the hassle and solves the problem, which improves our efficiency. But is it a disadvantage to use it?

The stored procedure is primarily a difficulty in later maintenance. When you find a stored procedure that seems wrong, or does not meet the new business requirements, no one dares to modify them, the best way is: Add a new one. So the number of stored oh process is becoming more and more difficult to name-the function is difficult to name is not the problem of coding, but the problem involved. Therefore, after two years of project operation, it is difficult to form a high-quality stable business development platform, people are still studying data tables, types ...

Speaking of which, we should draw a conclusion. The stored procedure is not good. Because we do the system, and so the teacher after the acceptance of the quiet on their own computer, no one will bother to ignore it. But some big projects are different, need to maintain at all times, and later maintenance will be more important.

But if we have this demand: the database has a large number of real-time operational data, it is necessary to regularly make these data simple rows and columns, and put in another database for analysis and statistics. In this case I prefer the stored procedure. The stored procedure should handle "data" rather than "business". and greatly reduced IO consumption, the real embodiment of its efficiency advantage.


using an EA to draw UML diagrams

1. The overall framework (package diagram) is more important

This is the first step to clarify the logical structure of this system.

2. Standard and granularity of three-layer partitioning

Some people are divided according to the function, some people are according to the table. Of course each has its own characteristics.

When you B when the granularity of the layers is too thin, it will appear B The layer is very bloated, almost a function of a class, so there is no logical judgment to say. However, if the granularity is small, it will feel that the B - layer Division function is not complete.

3. appearance mode is not optional

I always know why add appearance mode, I also never know why add appearance mode. When an interface use case is more, you need to instantiate the N business Logic layer, in order to implement each one, then create a look, the business logic layer of the class to consolidate. When the U -layer only needs an instance of an appearance class, it can all be implemented. But a form if there is only one function, then the appearance mode is really redundant. There is also the appearance layer should not appear logical judgment, because it is not a logical layer after all.

So the exterior layer should be there when it's needed, not when it's necessary (personal view)

4. Notes for Graphs

Let the master look at the picture, the teacher said the comments are added, I said I think can read it. She said that you can't read it for a few days. So I was obedient to add the notes. It is a bit of a struggle to think of what functions are not annotated. It has been said that good code comments will take up 50%. Look at a programmer's level to see his comments first. It is a habit, an attitude, an idea of serving the good.


EA Tips for using

Listen to a brother Siang to know the original EA is so powerful, I was how small. ea can import VS Code, which we all know, of course , ea can also design database directly imported database table, specific to a field and so on. The implementation of the interface, and so on, when we have not tried to feel very strong, at that time, we feel that their understanding of it is really smattering.


the system itself

1. focus on the implementation function, ignoring the details

(1) , input box prompt name, not just a MsgBox

(2) , the same user cannot log on to the system on duty at the same time

(3) , input limits for some input boxes

(4) , DataGridView Some considerations for tables

2. return entity and return DataTable

          simply say the difference, return datatable nature is simple and well understood, but this happens to contradict the decoupling thought between three layers through datatable To pass the data, the previous layer calls the next layer of data need to know datatable The name of the data field. This way, when some cows pass your error message, they are embedded in your database. It's not safe. Return entities are different, three layers through the entity communication, because each layer just know the name of the entity can be, do not know the specific field name. Of course the return generic collection can also be directly and gridview direct binding data source.

3. use of some of your own controls

There are many controls in the . NET framework that do not need to be installed, thus achieving a good reuse effect and a wide range of application platforms.

4. Importance of Annotations

includes header file comments (which can be predefined), code snippet comments, comments for special statements, and so on. The second time a comment is mentioned, the importance of the note is visible. This is the key to getting someone to read your code.


did not expect to summarize so much in a breath, no picture no truth, in short, all is text. When you knock out a layered system, you start the object-oriented journey, or you will drum up the palm of your own. One months of time in a hurry, you can say that every time get along with too much harvest. Programming is still continuing, will usher in the computer room charge system cooperation version, look forward to ...

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.