Physical organization of code

Source: Internet
Author: User

The same featureCodeTo put them together (a separate project in IDE or a separate folder in the project), these codes are either all or none, and they work together to complete a feature, if you no longer need this feature, you can delete it as a whole without leaving any code that is useless to the system as garbage. if you want to see how a feature is implemented, all the relevant code will be together and you do not need to skip in a large code library.

The ideal situation is:Source codeThe name of all the project files in the tree, or the name of the folder, you will know what functions the system provides. It can correspond to your requirement description, whether using user story or use case, they can be used as the project name or folder name for easy maintenance.

The default physical file organization of the popular MVC framework is not like this. The controller, model, and view are in different folders. ASP. net MVC provides virtualpathprovider and viewengine, which allows us to package a feature controller, model, or view into a project or folder, while the corresponding action and view can still be found during running, this is the feature we are using.

What is the impact of this Code Organization on the architecture?

This basically leads to the architecture based on plug-ins/extensions. put it on a larger scale, that is, SOA. SOA is king. this word is too big. Focus on the application of a process first ....

    1. How to aggregate the UI? The UI seen by the end user is an aggregation result, which may come from different parts of the system. the extension points to solve this problem include client Ajax or server-side renderaction. (Question: What should I do with CSS? How to determine the display sequence and layout of different parts ?)
    2. How does feature communicate? Feature cannot depend on each other. For example, the same data and business logic may be used. bounded context, context mapping, DCI... are the solutions to this problem.
    3. How are databases divided? Different feature uses their own independently defined data tables for ing and synchronization.
    4. How can we assemble these feature items together? The Java platform has osgi, And. Net does not currently see similar solutions like osgi. It is basically a path for registration or dynamic discovery, and follows the open and closed principles...

 

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.