Source Code Organization Method

Source: Internet
Author: User

Source codeOrganization Method


If a software development involves only one languageCodeManagement is relatively simple. based on different modules, you can directly divide them into different folders. for example, C can divide a project into moda, modb, modc, and other modules, and then MoD? Are divided into two types of files (folders): H and SRC. Under the H directory, submod1, submod2, and other sub-modules can be further divided into submod1 under the src directory, submod2 and other sub-modules can also be divided by other sub-modules.

This way of organization is for a language and also a way of dividing modules. Using modules as the criteria for division has a direct role in making it easier for developers to communicate with each other, because the division of modules corresponds to the division of functions, this is in line with the nature of software development for functional purposes. In this case, the hierarchical relationship between modules is not directly reflected, but another system definition and document description are required.

I am confused about the organization in multiple development languages. If C and C ++ are available at the same time, I can still follow the preceding organization method. But what if there is another Java?

According to the general idea, different development languages are applicable to different functional development. For example, Java is suitable for the intermediate service layer and customer access layer under the Multi-tier application architecture, which is fully utilized in the B/S architecture. The J2EE architecture is a good example. C/C ++ is more suitable for the development of functional modules at the basic level, and is suitable for intermediate service layers in multi-layer application architectures, as the preferred development language for driver development, Hardware Management, and network communication. Windows, Ace, and VxWorks are good examples. It can be seen that C/C ++ is mainly functional-oriented, while Java is application-oriented. Other languages, such as TCL, are suitable for writing scripts for automatic testing, and FORTRAN is suitable for accurate computing.

In this case, if the application scope of different languages is independent of each other, so that they concentrate on the design of a module, they can follow the preceding method of organizing a single language. However, if the same module involves different PL, such as C/C ++ and Java, obviously, the above method for C/C ++ cannot meet the management requirements of Java code. Java source code is not divided into two types: H/src, only. java files.

In this case, the folder hierarchy between the sub-module and the module is confusing. In fact, I am confused, and I can't write any more. My solution to this situation is still based on modules. Divide different languages in the root module. That is to say, all sub-modules in the same module are developed using the same Pl.

 

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.