javaEE的三层结构:web层、service层、dao层

学习JavaEE时,经常提到JavaEE三层或者四层结构

四层架构

展示层(web层)、业务逻辑层、数据访问层、信息资源层。

四层架构是在开发企业应用时使用的非常经典的划分模式。

web层负责前端展示和用户请求的处理。MVC是一个设计模式,主要用于构建用户页面,目的是把展示逻辑和逻辑分离。web层通常会使用MVC模式进行构建,经常使用的MVC框架包括spring mvc,structs等,都是在web层或者展示层使用的。

业务逻辑层一般应用中会有一层service抽象,实现核心业务逻辑,事务控制也在这一层实现。

数据访问层也即dao层,重点负责数据库访问,完成持久化功能。

信息资源层主要用于服务资源的存储。

所以MVC和四层(三层)结构有关系,四层架构是应用的体现(分层)结构,描述了整个应用的一个完整的划分,而MVC是一个设计模式,通常会用于四层架构的展示层的构建上。 

posted @ 2019-03-14 10:55  strawqqhat  阅读(775)  评论(0编辑  收藏  举报
#home h1{ font-size:45px; } body{ background-image: url("放你的背景图链接"); background-position: initial; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-origin: initial; background-clip: initial; height:100%; width:100%; } #home{ opacity:0.7; } .wall{ position: fixed; top: 0; left: 0; bottom: 0; right: 0; } div#midground{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -1; -webkit-animation: cc 200s linear infinite; -moz-animation: cc 200s linear infinite; -o-animation: cc 200s linear infinite; animation: cc 200s linear infinite; } div#foreground{ background: url("https://i.postimg.cc/z3jZZD1B/foreground.png"); z-index: -2; -webkit-animation: cc 253s linear infinite; -o-animation: cc 253s linear infinite; -moz-animation: cc 253s linear infinite; animation: cc 253s linear infinite; } div#top{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -4; -webkit-animation: da 200s linear infinite; -o-animation: da 200s linear infinite; animation: da 200s linear infinite; } @-webkit-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-o-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-moz-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @keyframes cc { 0%{ background-position: 0 0; } 100%{ background-position: 600% 0; } } @keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-webkit-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-moz-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-ms-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } }