简体   繁体   English

Web应用程序的存储库命名约定

[英]Repository naming conventions for web application

I have a web application that, like usual, is divided in two parts: server-side and client-side. 我有一个Web应用程序,像往常一样,分为两部分:服务器端和客户端。

I like to work with international naming conventions for everything, and I've been trying to find some conventions on how to name my repositories. 我喜欢为所有事情使用国际命名约定,并且我一直试图找到关于如何命名我的存储库的一些约定。

What should I name my repositories on GitHub? 我应该在GitHub上命名我的存储库?

server-side - For the server-side application client-side - For the client-side application 服务器端 - 对于服务器端应用程序客户端 - 对于客户端应用程序

I've also hear someone say that the server-side repository should be called API. 我也听到有人说服务器端存储库应该被称为API。

Is that correct? 那是对的吗? What would you guys do? 你们会做什么?

"server-side" and "client-side" sound great to me. “服务器端”和“客户端”听起来对我很好。

With naming conventions, if you have to think more than 1 minute about them, you're thinking too hard! 使用命名约定,如果你不得不考虑超过1分钟,你会想得太多! Just name it so that it is self-explanatory & clear, especially to yourself -- no one else is going to care about this as much as you do. 只需将其命名为不言自明且明确,特别是对自己而言 - 没有其他人会像你一样关心这一点。 Besides, names can always be easily changed later. 此外,以后可以随时轻松更改名称。

I assume you are developing an application which belongs together. 我假设您正在开发一个属于一起的应用程序。 The server and client side are related to each other. 服务器和客户端彼此相关。 This means to me to have a single repository called "Application" which contains both server and client side. 这意味着我有一个名为“Application”的存储库,它包含服务器端和客户端端。

Project layout conventions vary between languages and build systems. 项目布局约定因语言和构建系统而异。

For example a simple java web app could look like this when using the Maven build system. 例如,使用Maven构建系统时,简单的Java Web应用程序可能如下所示。

appname
|-- pom.xml
`-- src
    `-- main
        |-- java
        |   `-- com
        |       `-- company
        |           `-- appname
        |               `-- Controller.java
        `-- webapp
            `-- view.jsp

The view.jsp is the client side view and the Controller.java is the server side business logic. view.jsp是客户端视图, Controller.java是服务器端业务逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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