{"id":33221,"date":"2024-11-01T09:14:39","date_gmt":"2024-11-01T09:14:39","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=33221"},"modified":"2024-11-01T11:28:23","modified_gmt":"2024-11-01T11:28:23","slug":"spring-boot-backend-development-course-studying-spring-concepts","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/33221\/","title":{"rendered":"Spring Boot Backend Development Course, Studying Spring Concepts"},"content":{"rendered":"<p><body><\/p>\n<h2>Definition and Overview<\/h2>\n<p>\n        Spring Boot is a framework based on Java (Spring Framework) that enables rapid development of web applications and microservices.<br \/>\n        Spring Boot helps developers quickly create applications without complex configurations and provides various features for easily building REST APIs. In this article, we will delve into the fundamental concepts of Spring Boot and explore Spring concepts in depth.\n    <\/p>\n<h2>Basic Concepts of the Spring Framework<\/h2>\n<p>\n        The Spring Framework is an open-source application framework for the Java platform.<br \/>\n        This framework consists of the following core concepts:\n    <\/p>\n<ul>\n<li><strong>Dependency Injection:<\/strong> A method of managing relationships between objects without directly handling dependencies, allowing Spring to manage and create objects instead.<\/li>\n<li><strong>Separation of Concerns:<\/strong> Separating business logic from presentation logic to enhance code reusability and ease of maintenance.<\/li>\n<li><strong>AOP (Aspect-Oriented Programming):<\/strong> A method of modularizing common functionalities. It is used for log processing, transaction management, etc.<\/li>\n<\/ul>\n<h2>Advantages of Spring Boot<\/h2>\n<p>\n        Spring Boot offers the following advantages:\n    <\/p>\n<ul>\n<li><strong>Rapid Development:<\/strong> Simple configuration allows developers to implement necessary features immediately.<\/li>\n<li><strong>Auto Configuration:<\/strong> When developers add the appropriate libraries, Spring configures them automatically.<\/li>\n<li><strong>Standalone:<\/strong> Can be packaged as a JAR file, allowing it to run without a separate server.<\/li>\n<\/ul>\n<h2>Setting Up a Spring Boot Project<\/h2>\n<p>\n        To start a Spring Boot project, you can use Spring Initializer. This tool helps you easily set up the basic structure of the project and its required dependencies.\n    <\/p>\n<ul>\n<li>First, visit <a href=\"https:\/\/start.spring.io\">Spring Initializer<\/a>.<\/li>\n<li>Enter project metadata.<\/li>\n<li>Add the necessary dependencies and click the &#8216;Generate&#8217; button to download a ZIP file.<\/li>\n<li>Unzip the downloaded file and open it in an IDE to start development.<\/li>\n<\/ul>\n<h2>Basic Structure of Spring Boot<\/h2>\n<p>\n        The basic structure of a Spring Boot project is divided as follows:\n    <\/p>\n<pre>\n          \u2514\u2500\u2500 src\n              \u2514\u2500\u2500 main\n                  \u251c\u2500\u2500 java\n                  \u2502   \u2514\u2500\u2500 com\n                  \u2502       \u2514\u2500\u2500 example\n                  \u2502           \u2514\u2500\u2500 demo\n                  \u2502               \u251c\u2500\u2500 DemoApplication.java\n                  \u2502               \u2514\u2500\u2500 controller\n                  \u2502                   \u2514\u2500\u2500 HelloController.java\n                  \u2514\u2500\u2500 resources\n                      \u251c\u2500\u2500 application.properties\n                      \u2514\u2500\u2500 static\n    <\/pre>\n<h2>Main Annotations of Spring Boot<\/h2>\n<p>\n        Spring Boot provides various annotations to help developers configure quickly. The main annotations include:\n    <\/p>\n<ul>\n<li><code>@SpringBootApplication:<\/code> The entry point of the Spring Boot application, enabling auto-configuration and component scanning.<\/li>\n<li><code>@RestController:<\/code> Defines the controller for RESTful web services, returning JSON data.<\/li>\n<li><code>@RequestMapping:<\/code> Defines methods that handle HTTP requests.<\/li>\n<\/ul>\n<h2>Developing a REST API<\/h2>\n<p>\n        Let&#8217;s explore how to develop a REST API using Spring Boot. A REST API communicates via the HTTP protocol and is responsible for data exchange between the client and the server. Here is a simple example of an API:\n    <\/p>\n<h3>1. Writing the Controller<\/h3>\n<pre><code>\n    import org.springframework.web.bind.annotation.GetMapping;\n    import org.springframework.web.bind.annotation.RestController;\n\n    @RestController\n    public class HelloController {\n\n        @GetMapping(\"\/hello\")\n        public String hello() {\n            return \"Hello, Spring Boot!\";\n        }\n    }\n    <\/code><\/pre>\n<h3>2. Running and Testing<\/h3>\n<p>\n        After writing the above code, when you run the application, you can send a GET request to the <code>\/hello<\/code> endpoint to receive the message &#8216;Hello, Spring Boot!&#8217;.\n    <\/p>\n<h2>Deepening Spring Concepts<\/h2>\n<p>\n        We will take a deeper look at fundamental concepts of Spring Boot such as dependency injection, application context, and AOP.\n    <\/p>\n<h3>Dependency Injection<\/h3>\n<p>\n        Dependency injection is a core element of the Spring Framework. It allows for lower coupling and increased flexibility by injecting necessary objects from external sources rather than creating them directly.<br \/>\n        Here is an example of dependency injection:\n    <\/p>\n<pre><code>\n    import org.springframework.beans.factory.annotation.Autowired;\n    import org.springframework.stereotype.Service;\n\n    @Service\n    public class UserService {\n        private final UserRepository userRepository;\n\n        @Autowired\n        public UserService(UserRepository userRepository) {\n            this.userRepository = userRepository;\n        }\n\n        public User findUser(Long id) {\n            return userRepository.findById(id).orElse(null);\n        }\n    }\n    <\/code><\/pre>\n<h3>Spring AOP<\/h3>\n<p>\n        AOP is a method of modularizing common concerns in a program. It is particularly useful for logging, security, and transaction management.<br \/>\n        With AOP, you can perform additional actions before and after specific method executions.\n    <\/p>\n<pre><code>\n    import org.aspectj.lang.annotation.Aspect;\n    import org.aspectj.lang.annotation.Before;\n    import org.springframework.stereotype.Component;\n\n    @Aspect\n    @Component\n    public class LoggingAspect {\n\n        @Before(\"execution(* com.example.demo.service.*.*(..))\")\n        public void logBefore() {\n            System.out.println(\"Before method call: Logging output\");\n        }\n    }\n    <\/code><\/pre>\n<h2>Connecting to a Database<\/h2>\n<p>\n        Connecting to a database using Spring Boot is also an important aspect.<br \/>\n        You can interact easily with the database through JPA and Spring Data JPA.\n    <\/p>\n<h3>1. Adding Dependencies<\/h3>\n<pre><code>\n    dependencies {\n        implementation 'org.springframework.boot:spring-boot-starter-data-jpa'\n        runtimeOnly 'com.h2database:h2'\n    }\n    <\/code><\/pre>\n<h3>2. Defining the Entity Class<\/h3>\n<pre><code>\n    import javax.persistence.Entity;\n    import javax.persistence.GeneratedValue;\n    import javax.persistence.GenerationType;\n    import javax.persistence.Id;\n\n    @Entity\n    public class User {\n        @Id\n        @GeneratedValue(strategy = GenerationType.IDENTITY)\n        private Long id;\n        private String name;\n\n        \/\/ getters and setters\n    }\n    <\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>\n        Spring Boot is a framework that supports fast and easy development of Java-based applications.<br \/>\n        In this article, we explored the basic concepts of Spring Boot, REST API development, Spring Data JPA, AOP, and more.<br \/>\n        Utilize Spring Boot to build an efficient backend development environment.\n    <\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Definition and Overview Spring Boot is a framework based on Java (Spring Framework) that enables rapid development of web applications and microservices. Spring Boot helps developers quickly create applications without complex configurations and provides various features for easily building REST APIs. In this article, we will delve into the fundamental concepts of Spring Boot and &hellip; <a href=\"https:\/\/atmokpo.com\/w\/33221\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Spring Boot Backend Development Course, Studying Spring Concepts&#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-33221","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, Studying Spring Concepts - \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\/33221\/\" \/>\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, Studying Spring Concepts - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Definition and Overview Spring Boot is a framework based on Java (Spring Framework) that enables rapid development of web applications and microservices. Spring Boot helps developers quickly create applications without complex configurations and provides various features for easily building REST APIs. In this article, we will delve into the fundamental concepts of Spring Boot and &hellip; \ub354 \ubcf4\uae30 &quot;Spring Boot Backend Development Course, Studying Spring Concepts&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/33221\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:14:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:28:23+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=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Spring Boot Backend Development Course, Studying Spring Concepts\",\"datePublished\":\"2024-11-01T09:14:39+00:00\",\"dateModified\":\"2024-11-01T11:28:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/\"},\"wordCount\":586,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Spring Boot backend development\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/\",\"url\":\"https:\/\/atmokpo.com\/w\/33221\/\",\"name\":\"Spring Boot Backend Development Course, Studying Spring Concepts - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:14:39+00:00\",\"dateModified\":\"2024-11-01T11:28:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/33221\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/33221\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Boot Backend Development Course, Studying Spring Concepts\"}]},{\"@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, Studying Spring Concepts - \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\/33221\/","og_locale":"ko_KR","og_type":"article","og_title":"Spring Boot Backend Development Course, Studying Spring Concepts - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Definition and Overview Spring Boot is a framework based on Java (Spring Framework) that enables rapid development of web applications and microservices. Spring Boot helps developers quickly create applications without complex configurations and provides various features for easily building REST APIs. In this article, we will delve into the fundamental concepts of Spring Boot and &hellip; \ub354 \ubcf4\uae30 \"Spring Boot Backend Development Course, Studying Spring Concepts\"","og_url":"https:\/\/atmokpo.com\/w\/33221\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:14:39+00:00","article_modified_time":"2024-11-01T11:28:23+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":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/33221\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/33221\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Spring Boot Backend Development Course, Studying Spring Concepts","datePublished":"2024-11-01T09:14:39+00:00","dateModified":"2024-11-01T11:28:23+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/33221\/"},"wordCount":586,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Spring Boot backend development"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/33221\/","url":"https:\/\/atmokpo.com\/w\/33221\/","name":"Spring Boot Backend Development Course, Studying Spring Concepts - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:14:39+00:00","dateModified":"2024-11-01T11:28:23+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/33221\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/33221\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/33221\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Spring Boot Backend Development Course, Studying Spring Concepts"}]},{"@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\/33221","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=33221"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/33221\/revisions"}],"predecessor-version":[{"id":33222,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/33221\/revisions\/33222"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=33221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=33221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=33221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}