Posts

Showing posts with the label springBoot

01.SpringBoot - Topics

Image
 Topics Introduction Dependency Injection - Spring Container Project Creation application.properties file and application.yml file

01. Introduction

Image
  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 E nterprise වලදී   spring සමග වැඩ කරන විට lot of jar file and lot of configuration කරන්න සිද්ද වෙනවා . නමුත් developer වැඩිය time එක වැය කරන්න ඕනේ සහ එය focus කරන්න ඕනේ වෙන්නේ development එක ගැන වන අතර configuration   එක ගැන නෙවෙයි . එක අමතර effort එකක් වෙන්වා . එම නිසා කලයත් එක්ක මෙම අවශ් ‍ ය වන libararies ටික සහ configuratin ඔක්කොම දාලා developer ට අන්තිමට production ready product එකක් දෙන්න පුළුවන් technology එකක් එලියට ...

02.Dependency Injection - Spring Container.

Image
  Dependency Injection - Spring Container . Object එකක් තව object එකක් මත depend වෙනවා . O bject hierarchy එකක් වගේ තම තියෙන්නේ . එම dependencies අප විසින් handle නොකරන අතර එය spring, spring boot වලින් handle කරනු ලබයි . Example එකක් ලෙස laptop class එක සලකන්න . Laptop එකක් තව ගොඩක් දේවල් මත රදා පවතිනවා hard drive, ram වගේ ඒවා මත . අප laptop object එකක් හදන විට එකට අදාල ඒ dependencies එනම් hard drive, ram වගේ ඒවා දාලා අපි හදන්න යන්නේ නෑ . අපි කරන්නේ අපි framwork එකන් ඉල්ලනවා මට laptop එකක් ඕනේ කියලා . framwork එක ඕනේ කරන සියලුම dependencies ටික දාලා අන්තිමට අපිට full comlete laptop එක දෙනවා . එනම් අවශ්‍ය වන dependencies ටික හදල inject කරන්නේ frmawork එකෙන් . ඒක තමා dependency injection කියන්නේ . මෙය spring boot වලදී කරනු ලබන්නේ Spring Container මගිනි . මෙය අවශ්‍ය වෙන්නේ ඇයි , Loosely coupled කියන එක ලගා කරගන්න සහ application එක easily test කරන්න පුලුවන් වෙන්න තමා dependency injection ...