Programmer’s professional ethics: package naming convention

Variable naming believes that many pitted friends don’t want to listen anymore, pay attention to “again” instead of “in” (knocking on the blackboard!!!), then let’s talk about the programmer’s career from this naming convention today. Morality!

First of all, I need to mention a B station UP host " Don't learn programming ". The name is very interesting. Just by looking at it, he must be a humorous person. It’s so good for me to learn programming, and I also advise others not to enter the IT industry. This is unclear how to pull you into the pit. Hahaha······

In the C# contributed by ta from entry to dropout O(∩_∩)O haha~ , I heard the video lecturer say a very authentic but vigilant sentence: “It’s a rascal if you don’t write comments, and it’s nonsense to name it. . "

I admit that I have obsessive-compulsive disorder, especially when I learn other things outside of class, I can’t help recording all the “dry goods” in " Impression Notes ", and I’m super caressed, and I have to write down my notes. If you can read it well, you can synchronize it from the PC to the Android after removing the language problems of the lecture notes. Here I also want to recommend everyone, especially my brother Ji Meimeng who is studying hard for himself. Although paper notes have an irreplaceable role, electronic notes are still better in the turmoil of the Internet. It can be posted on the public website and everyone can learn from each other. Secondly, you can freely check notes when the network is open, and check for missing and fill in the gaps in time. Of course, if you are used to getting up early in the morning, you can also read the notes you wrote yesterday with your mobile phone micro terminal. Over time, you will definitely meet your best self!

Okay, that’s all, I’m going to watch the video to learn, and finally share a wave of development package naming conventions. I haven't done real development, the following are all sorted out by myself, welcome to consult and Zhengzheng!


Data access layer package name: dao
data access layer implementation class package name: dao.impl
business logic layer package name: service
business logic layer implementation class package name: service.impl
data transmission object layer: dto, vo
controller layer: controller
data persistent entity Bean layer: bean, beans, domain, entity
means layer: utils
filter layer: filter
requesting layer: action, actions
interceptor layer: interceptor, interceptors
model layers: model
I have contact on these matter, include the Naming is just as exhausting... and there are others: the most complete Java naming convention in history! Say goodbye to 5 minutes of coding and 2 hours of naming?

Package naming convention (generally 4~5 levels):
Party A’s domain name + project name + module name + function top-level package + implementation class sub-package
For example: com.wanakiko.pojoName.moduleName.dao.impl
disassembly:
    com .wanakiko is the reversed domain name of Party A’s listed above.
    pojoName is the name of the currently developed project.
    moduleName is the name of the module currently being implemented.
    dao is the function top-level package
    impl is the implementation class sub-package under the function top-level package

Tips: The use of multi-level package naming conventions is to ensure that the resources defined in the package are globally unique .

Guess you like

Origin blog.csdn.net/qq_44965393/article/details/112006703