01. Introduction

 

SPRING BOOT

01. Introduction

Spring

java use කරලා enterprise applicati develop කරද්දී 2000 පමණ කාලයේදී EJB හෙවත් enterprise java beans technology use කල අතර එය manage කරගැනීමේ තිබ්බ දුෂ්කරතා නිසා,maintain කරගැනීමේ අපහසුතා නිසා කල් යාමත් එක්ක Sping frmawork එක හදුන්වා දුන් අතර එය pure EJB වලට වඩා easyly වැඩ කිරීමේ හැකියාව පවතී. එය විවිද framwork සමගද වැඩ කිරීමේ හැකියාව ඇති frmawork වීම තවත් adavantage එකක් වේ(hibernate,Struts වගේ).

Why spring boot comming

Enterprise වලදී  spring සමග වැඩ කරන විට lot of jar file and lot of configuration කරන්න සිද්ද වෙනවා.නමුත් developer වැඩිය time එක වැය කරන්න ඕනේ සහ එය focus කරන්න ඕනේ වෙන්නේ development එක ගැන වන අතර configuration  එක ගැන නෙවෙයි.එක අමතර effort එකක් වෙන්වා.එම නිසා කලයත් එක්ක මෙම අවශ් වන libararies ටික සහ configuratin ඔක්කොම දාලා developer අන්තිමට production ready product එකක් දෙන්න පුළුවන් technology එකක් එලියට එනවා. තමා springboot කියන්නේ.මතක තබාගත යුතු දෙයක් තමා මෙයින් spring replace නොවන අතර මෙහිදී වෙන්නේ spring වලටම library සහ configuration add කරලා production ready product එකක් දෙන්න පුළුවන් විදිහට spring සහ developer අතර මෙය add උන එක විතරයි.මෙමගින් full stack development කරන්න පුළුවන් අතර නමුත් මෙහිදී mainly focus කරන්නේ service develop කිරීම වේ(Microservices වැනි).



Normally web applications develop කරලා අපි කරන්නේ මොකද්ද, එහෙදි ගන්න war file එක server එකක deploy කිරීම.නමුත් spring boot application වලදී embedded server එකක් පවතී.එම නිසා spring boot application එකකට පිටින් server add කිරීම අවශ්‍ය නොවේ.

Normally application එකක් deploy කරද්දී සහ spring boot application එකක් deploy කරද්දී,



Custom configurations in spring boot.

Extra thing: Loosely couple – one object is not totally depend on other object.

Spring Boot වලින් කිසිම xml file එකක් custom configuration සදහා provide නොකරන අතර සදහා application.properties file එකක් ලබාදේ.ඒම application.properties file එක හරහා අවශ්‍ය configurations කරගත හැක(application.yml නම් file එකක් create කිරීමෙන්ද configuration කරගනු ලබයි). Example ලෙස,

spring.mvc.view.prefix= /view/

spring.mvc.view.suffix=.jsp

 

#spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.url=jdbc:mysql://localhost:3306/springbootjpajwtsecuritydb

spring.datasource.username=root

spring.datasource.password=root

spring.jpa.show-sql=true

spring.jpa.hibernate.ddl-auto=update


Comments

Popular posts from this blog

09.Data Binding.

Database - Topics

02. Spring – Creating spring project clone it with GIT step by step.