{"id":33239,"date":"2024-11-01T09:14:47","date_gmt":"2024-11-01T09:14:47","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=33239"},"modified":"2024-11-01T11:28:19","modified_gmt":"2024-11-01T11:28:19","slug":"spring-boot-backend-development-course-portable-service-abstraction","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/33239\/","title":{"rendered":"Spring Boot Backend Development Course, Portable Service Abstraction"},"content":{"rendered":"<p><body><\/p>\n<p>In modern software development, portability has become a very important factor. In backend development, it is necessary to effectively manage business rules through service abstraction, improve maintainability, and facilitate collaboration between teams. In this course, we will focus on backend development using Spring Boot, and deeply explore the concepts and implementation (methodology) of portable service abstraction.<\/p>\n<h2>1. What is Service Abstraction?<\/h2>\n<p>Service Abstraction is the concept of separating specific business functionalities so that developers implementing business logic are not affected by various changes in the system. Through this, developers can access functionalities through the abstracted service and minimize the impact of changes in the service implementation on the client.<\/p>\n<h3>1.1 Importance of Service Abstraction<\/h3>\n<ul>\n<li><strong>Improved maintainability:<\/strong> By separating services from business logic, code modifications can be made more easily.<\/li>\n<li><strong>Reusability:<\/strong> By reusing services that are written once in multiple places, code duplication can be reduced.<\/li>\n<li><strong>Ease of testing:<\/strong> Service abstraction helps to facilitate unit testing.<\/li>\n<\/ul>\n<h2>2. Implementation of Service Abstraction in Spring Boot<\/h2>\n<p>Spring Boot is a Java-based framework that provides various features to easily implement service abstraction. Here, we will explain how to define services using the <code>@Service<\/code> annotation and inject necessary components through <code>Dependency Injection<\/code>.<\/p>\n<h3>2.1 Setting up a Spring Boot Project<\/h3>\n<pre><code>mvn archetype:generate -DgroupId=com.example -DartifactId=myapp -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false<\/code><\/pre>\n<h3>2.2 Setting dependencies<\/h3>\n<p>First, add the Spring Boot starter dependency to the <code>pom.xml<\/code> file.<\/p>\n<pre><code>&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter&lt;\/artifactId&gt;\n&lt;\/dependency&gt;<\/code><\/pre>\n<h3>2.3 Defining Service Interface<\/h3>\n<p>Define an interface for service abstraction.<\/p>\n<pre><code>public interface UserService {\n    User createUser(User user);\n    User getUserById(Long id);\n    List&lt;User&gt; getAllUsers();\n    void deleteUser(Long id);\n}<\/code><\/pre>\n<h3>2.4 Implementing the Service<\/h3>\n<p>Now, create a class that implements the interface defined above.<\/p>\n<pre><code>@Service\npublic class UserServiceImpl implements UserService {\n    \/\/ Inject Repository to perform database operations\n    @Autowired\n    private UserRepository userRepository;\n\n    @Override\n    public User createUser(User user) {\n        return userRepository.save(user);\n    }\n\n    @Override\n    public User getUserById(Long id) {\n        return userRepository.findById(id).orElse(null);\n    }\n\n    @Override\n    public List&lt;User&gt; getAllUsers() {\n        return userRepository.findAll();\n    }\n\n    @Override\n    public void deleteUser(Long id) {\n        userRepository.deleteById(id);\n    }\n}<\/code><\/pre>\n<h2>3. Using Services through REST API<\/h2>\n<p>Now, we will create a controller to provide the user service in the form of a REST API.<\/p>\n<pre><code>@RestController\n@RequestMapping(\"\/api\/users\")\npublic class UserController {\n    @Autowired\n    private UserService userService;\n\n    @PostMapping\n    public ResponseEntity&lt;User&gt; createUser(@RequestBody User user) {\n        return ResponseEntity.ok(userService.createUser(user));\n    }\n\n    @GetMapping(\"\/{id}\")\n    public ResponseEntity&lt;User&gt; getUserById(@PathVariable Long id) {\n        User user = userService.getUserById(id);\n        return ResponseEntity.ok(user);\n    }\n\n    @GetMapping\n    public ResponseEntity&lt;List&lt;User&gt;&gt; getAllUsers() {\n        return ResponseEntity.ok(userService.getAllUsers());\n    }\n\n    @DeleteMapping(\"\/{id}\")\n    public ResponseEntity&lt;Void&gt; deleteUser(@PathVariable Long id) {\n        userService.deleteUser(id);\n        return ResponseEntity.noContent().build();\n    }\n}<\/code><\/pre>\n<h2>4. Conclusion<\/h2>\n<p>In this course, we learned about how to implement portable service abstraction during backend development using Spring Boot. Service abstraction maximizes development efficiency by providing maintainability, ease of testing, and code reusability. By utilizing various features of Spring Boot to design practical services, we hope to elevate your development capabilities to the next level.<\/p>\n<h2>5. Preview of the Next Course<\/h2>\n<p>In the next course, we will cover database management in Spring Boot and implementing ORM through JPA\/Hibernate. We appreciate your interest!<\/p>\n<footer>\n<p>\u00a9 2023 Your Name. All Rights Reserved.<\/p>\n<\/footer>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In modern software development, portability has become a very important factor. In backend development, it is necessary to effectively manage business rules through service abstraction, improve maintainability, and facilitate collaboration between teams. In this course, we will focus on backend development using Spring Boot, and deeply explore the concepts and implementation (methodology) of portable service &hellip; <a href=\"https:\/\/atmokpo.com\/w\/33239\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Spring Boot Backend Development Course, Portable Service Abstraction&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[131],"tags":[],"class_list":["post-33239","post","type-post","status-publish","format-standard","hentry","category-spring-boot-backend-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/33239\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"In modern software development, portability has become a very important factor. In backend development, it is necessary to effectively manage business rules through service abstraction, improve maintainability, and facilitate collaboration between teams. In this course, we will focus on backend development using Spring Boot, and deeply explore the concepts and implementation (methodology) of portable service &hellip; \ub354 \ubcf4\uae30 &quot;Spring Boot Backend Development Course, Portable Service Abstraction&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/33239\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:14:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:28:19+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Spring Boot Backend Development Course, Portable Service Abstraction\",\"datePublished\":\"2024-11-01T09:14:47+00:00\",\"dateModified\":\"2024-11-01T11:28:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/\"},\"wordCount\":349,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Spring Boot backend development\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/\",\"url\":\"https:\/\/atmokpo.com\/w\/33239\/\",\"name\":\"Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:14:47+00:00\",\"dateModified\":\"2024-11-01T11:28:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/33239\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/33239\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Boot Backend Development Course, Portable Service Abstraction\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/33239\/","og_locale":"ko_KR","og_type":"article","og_title":"Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"In modern software development, portability has become a very important factor. In backend development, it is necessary to effectively manage business rules through service abstraction, improve maintainability, and facilitate collaboration between teams. In this course, we will focus on backend development using Spring Boot, and deeply explore the concepts and implementation (methodology) of portable service &hellip; \ub354 \ubcf4\uae30 \"Spring Boot Backend Development Course, Portable Service Abstraction\"","og_url":"https:\/\/atmokpo.com\/w\/33239\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:14:47+00:00","article_modified_time":"2024-11-01T11:28:19+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/33239\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/33239\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Spring Boot Backend Development Course, Portable Service Abstraction","datePublished":"2024-11-01T09:14:47+00:00","dateModified":"2024-11-01T11:28:19+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/33239\/"},"wordCount":349,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Spring Boot backend development"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/33239\/","url":"https:\/\/atmokpo.com\/w\/33239\/","name":"Spring Boot Backend Development Course, Portable Service Abstraction - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:14:47+00:00","dateModified":"2024-11-01T11:28:19+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/33239\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/33239\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/33239\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Spring Boot Backend Development Course, Portable Service Abstraction"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/33239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=33239"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/33239\/revisions"}],"predecessor-version":[{"id":33240,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/33239\/revisions\/33240"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=33239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=33239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=33239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}