问题描述
我是春季靴子的初学者。我参与了一个项目的开始,我们将使用spring boot构建休息服务。在构建一个只暴露其他服务的项目时,能否请您建议建议的目录结构?
I'm a beginner with spring boot. I'm involved in the beginning of a project where we would build rest services using spring boot. Could you please advise the recommended directory structure to follow when building a project that will just expose rest services?
推荐答案
你做不需要做一些特别的事情才能开始。从普通的java项目开始,可以是maven或gradle,也可以是具有入门依赖性的IDE项目布局。
You do not need to do anything special to start. Start with a normal java project, either maven or gradle or IDE project layout with starter dependency.
根据指南和休息......
You need just one main class, as per guide here and rest...
没有受约束的包结构。实际结构将由您的需求/异想天开驱动,目录结构由build-tool / IDE奠定
您可以遵循相同的结构以下是一个Spring MVC应用程序。
You can follow same structure that you might be following for a Spring MVC application.
你可以按照任何一种方式
You can follow either way
-
项目分为几个层次:
A project is divided into layers:
例如:DDD样式
- 服务层:服务包包含服务类
- DAO / REPO层:包含dao类的dao包
- 实体层
或
or
任何适合您的问题的层结构你在写问题。
any layer structure suitable to your problem for which you are writing problem.
项目分为模块或功能或特征,A模块分为如上所述的层次
A project divided into modules or functionalities or features and A module is divided into layers like above
我更喜欢第二种,因为它遵循商业环境。从概念的角度思考。
I prefer the second, because it follows Business context. Think in terms of concepts.
您所做的工作取决于您对项目的看法。这是你的代码组织技能。
What you do is dependent upon how you see the project. It is your code organization skills.
这篇关于春季引导休息项目的推荐项目结构是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!