Сообщения

MS Lesson6: IoC, DI, Spring Context, ApplicationContext

 1. IoC - Inversion of Control Ə n  əsas ide ya  budur : Ə vvəl   (klass ik  Java ) : sən  oby ektləri  özün yar adırsan  ( new Service () ,  new Repo () ) , kim  kim dən  asılı dır ham ısını  öz ün  bağ layırsan. Io C-də : bu  nə zarəti  container -ə verirs ən   (Spring ) . O  oby ektləri  özü  yar adır və  bağ layır. Y əni   n ə zarət  istiq am əti  çev rilir : əvvəl : sən  idar ə  ed ird in indi : framework  idarə edir B una görə  adı   “Inversion of Control ”. 2. DI - Dependency Injection DI , IoC -ni  praktikada  həyata  keç irm ə üsul udur. Sənin  class -ın  başqa  class-a ehtiyac  duyursa , o  dependency-ni  iç ər id ə   new  etm irs ən. K ən ardan ver ilir   (inject  olunur ). Məs ələn : Test Controller -a   StudentIdGenerator Service  lazımdır . Constructor  ilə...

MS Lesson5: Spring Configuration

 1. @Value server.port = 9595 amazon.url = "https://amazon.com/transfer" package com.amazon.demoapp.config; import com.amazon.demoapp.controller.Student; import org.springframework.beans.factory.annotation. Value ; import org.springframework.context.annotation. Bean ; import org.springframework.context.annotation. Configuration ; @Configuration public class BeanConfiguration { @Value ( "${amazon.url}" ) private String url ; @Bean public Student getStudent () { System. out .println( "Azericard url is: " + url ); return new Student(); } } 2. @ConfigurationProperties package com.amazon.demoapp.config; import com.amazon.demoapp.controller.Student; import org.springframework.beans.factory.annotation. Value ; import org.springframework.boot.context.properties. ConfigurationProperties ; import org.springframework.context.annotation. Bean ; import org.springframework.context.annotation. Configuration ; @Configuration @Configurat...

MS Lesson4: HTTP vs HTTPS

Https ile spring boot configuration. Keystore yaratmaq: terminalda: keytool -genkeypair \   -alias demoapp \   -keyalg RSA \   -keysize 2048 \   -storetype PKCS12 \   -keystore src/main/resources/keystore.p12 \   -validity 3650   Bunun ucun Proxyman - da sorgu atiriq, sadece sorgu bu shekilde olacaq:  https://localhost.proxyman.io:9595/param?id=1&name=Parvin&surname=Etibarli Keystore silmek: rm src/main/resources/keystore.p12 Case1 — Happy  case  (saxt ak arlıq yoxdur) A-da   a_k ilid   (public),  a _ac ar  (private ) var. B -də   b_kil id  (public) ,   b_acar   (private) var. C sadəcə kury erd ir. Add ım  1 (ilk  paylaş ım): A   a_kil id -i B -y ə  gönd ərir. B   b_kil id -i A -ya göndərir . C  istəsə  bu  kil idləri kopy alaya  bilər, amma  bu  normal dır   (public -dir ). Addım  2   (A  - > B  mesaj ): A ...