If you are a. Net programmer

Source: Internet
Author: User

I am a. Net cupProgramMember. What I learned in school is thatC Language. When I graduated, I finally had a company that hosted embedded development. After three months of work, the embedded department was transferred to another place. I stayed firmly and went to the. NET department of the company to study. net.

This is a magic department. Most of them have many years of Java development experience. net, while sighing the slow development of the Java language for so many years and supporting the relatively powerful functions of C. net is not very successful, but it is strange that they always use Java ideas for architecture. net program, I don't think there is anything strange with them, because I used to only use C language. Later, I resigned to another company and met many. Net programmers. They were a bit clear about their sighs, and they started to get depressed and tangled. Many. net programmers have very weak oo ideas. in B/S mode, their three-tier architecture is like this. In their projects, there will be three class library projects with similar names, one XXX. model, a XXX. dal, a xxx. bal. the model layer is the ing of database tables. The fields and attributes correspond one to one. The Dal layer is the logic for splicing SQL strings in large segments, because it is the splicing logic. Code String = ''instead of string. Empty. Str = str1 + str1 is everywhere, and stringbuilder is rarely used. The bll layer is a large segment that generates strings based on the business and is provided to the Dal layer for SQL splicing. If it is difficult to splice data, a view is used. If it is more complex, a stored procedure is used, view and database user-defined functions are tangled, and then complicated. Views, stored procedures, user-defined functions and Dal-layer SQL are tangled to death. Finally, the result is that all classes only have methods and no attributes. Many methods are forwarded to the lower layer. Many methods can be static or even static, it is precisely because there is no property that their classes can be easily reconstructed using the move method (pai_^, Khan, ridicule ), because no way is put in any class without errors. If you tell him that your code is not Oo, there are two typical cases. The first one is: why is my code not OO, if you look at so many categories and you look at so many layers, why am I not so OO? I use pure oo C #. Why not OO. the second type: OO cannot solve all the problems either. The three-layer architecture is a classic architecture. It is an improvement of OO and is recommended by Microsoft. For the first type, I basically keep the distance. It's an OO layman, or a programming layman. For the second type, use the pure OO language C #, based on. net Framework is a pure oo architecture framework for development, so you don't need to use object-oriented ideas to design the program architecture. When are you going to use it? People who use C ++ do not use object-oriented ideas to design their code generation. They also use C ++ to do anything. The reason is that. Net programmers do not know that the layer-3 architecture is in conflict with OO to some extent. The separation of attributes and Operations violates the basic definition of classes. Although the three-layer architecture is equally contradictory to Java, at least Java still knows this problem, so there are anemia models, congestion models, and Domain Models, orm and so on. In addition, the minority in the middle view is even more tangled. As long as programmers use the results of OO research, they write procedural programs in pure object language and use object-oriented programs. NET framework? Isn't it true?. Net programmers do not know about dependency injection or Aspect-Oriented Programming, so it is unacceptable to introduce spring.net and objectbuilder to them. The reason for rejection is depressing to me, there are many useful frameworks and writing classes. So many configurations have an impact on performance. In their code, there are "Three-Field Theory of function". These three sections are: Execution logic, log writing, exception handling, and repeated three-field theory. Finally, even the dataaccess block in the Microsoft Enterprise Library is hard to accept, because they love sqlhelper. Every time there is a project, when I am still planning what classes, what properties and operations there are, many. Net programmers have already created tables in the database. I am not opposed to creating a database first, but we have to consider how to connect the database and objects first. However, they do not understand the differences between the relational model and the object model. After the database is created, a model is created. After the database is created, You have to operate the database. Therefore, another dal is created, but no business logic is available now. Therefore, the Dal layer begins to combine the splicing logic of SQL statements, then the upper layer can be pieced together by providing strings to the Dal. What is the upper layer? BLL. Finally, scan the entire program and you will find that, programming means that SQL strings flow everywhere and become longer and longer in the flow, from simple to complex. Otherwise, the SQL statement is written in the stored procedure, and the program is the condition for execution of the stored procedure to flow everywhere. It seems like a string or text processing program at a glance. To sum up, it has already reached the later oo era. Many net programmers still use hot weapons with the concepts and methods of the Bronze Age.

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.