--- – SPRING FRAMEWORK – BA



--- – SPRING FRAMEWORK – BA

0 1


TrainingSpringBASlide

TrainingSpringBASlide

On Github AnuchitPrasertsang / TrainingSpringBASlide

---

SPRING FRAMEWORK

@NongComEng@

Anuchit Prasertsang

from SoftPlus Family

BA

  • อนุชิต ประเสริฐสังข์  (หน่อง)GOAL          เขียนโปรแกรมต้องสนุกสนานเพลิดเพลิน(ฟิน)LITTLE KNOW FACT          ชอบนั่งสมาธิ          ชอบสีขาว,ฟ้า          อยากเป็น Super Saiyan GoD

BA

Introduction

Spring Framework

BA

Agenda

  • What is Spring framework ?
  • Spring framework architecture
  • Spring Concept
  • Spring Message Source
Test Note

BA

BA

What is Spring framework ?

  • Spring Framework is open source application framework for Java platform
  • Light-weight yet comprehensive framework for building Java SE and Java EE applications

BA

Spring framework architecture

BA

BA

Bean

BA

Basic Bean Creation

						HelloWorld hello = new mypackage.HelloWorld();
						
						<bean id="hello" class="mypackage.HelloWorld"></bean>
						

BA

BA

Inversion of Control (IoC)

  • IoC is a principle that externalizes the creation and management of component dependencies.

BA

Dependency Inversion Principle (DIP)

"High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions."

"Abstraction"

BA

Cr.www.somkiat.cc

BA

public class Email { 
	public void send() {	
	}
}
                
public class Notification {
	Email email;
	public Notification() {
		    email = new Email();
	}
	public void notifyPromotion() {
		    email.send();
	}
 
}                

Violation DIP

BA

BA

public interface MessageService {
	public void send();
 
}
                
public class Email implements MessageService { 
	public void send() {	
	}
}
                
public class Notification {
	MessageService messageService;
	public Notification() {
		    messageService = new Email();
	}
	public void notifyPromotion() {
		    messageService.send();
	}
 
}            

BA

Dependency Injection (DI)

  • Aims to offer a simpler mechanism for provisioning component dependencies and managing these dependencies throughout their lifecycles.
  • "Container" resolves (injects) dependencies of components by setting implementation object (push)

BA

BA

Spring Message

BA

Th@nk You

BA

BA

0