简体   繁体   中英

software architecture of .net application

How does Modules, Class, Namespace, Project,Folder,File relate in software architecture of c# application. Are modules a group of class and analogous to namespace. Or are modules the project itself?

Eg if we are talking of Authentication Module ,are we actually talking about namespace or just a folder or a file for instance (since a file can contain all classes required for login).

I have found that many people use it differently . What is the right way to do it ,I am sure there must be a well defined way out there.

As you already found, there is no one correct answer. It depends on the context.

Usually, a module is a component for a specific concern. This brings us to the question what a component is. One possible definition is:

A component is a container with content, variation points and extension points that are adapted during composition.

So actually, this could be anything - a class, a set of classes, a whole software system (eg a web service)... It really depends on the context.

Namespaces are just a way to structure your classes. You can (but not necessarily) group the content of a module within a namespace.

A project can be a module, but it can also contain several modules. Furthermore, a module can be spread across several projects.

A folder is just an organization scheme to structure source files. It has nothing to do with software architecture. The same applies for files.

The basic point of modules is the separation of concerns. When developing a module, you dedicate your whole thinking to a single (or a few) problem, abstracting from the other concerns. However, you should always keep the entire system in your mind.

In VB.Net, a module is a static class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM