티스토리 뷰
정보 보관 ver1.0
.NET Framework4.0 & MVC3.0 & IoC(Inversion of Control) 설계 패턴-캐슬 윈저(v2.5.3)
James Wetzel 2011. 6. 16. 12:50IoC(Inversion of Control)?
IoC는 응용프로그램의 구성 요소들을 다른 구성 요소들과 분리할 수 있게 도와주는 소프트웨어 설계 패턴이다.
IoC 컨테이너는 구성 요소의 인스턴스를 생성할 때마다 자동적으로 해당 구성 요소의 의존성을 해석한다.
그 결과 만약 컨트롤러가 어떤 의존성을 가지고 있다면 IoC 컨테이너가 적절한 인스턴스를 제공해 주게 될 것이다.
이 작업은 구성 요소들 간의 의존성을 자연스럽게 분리해 주고, 더 약한 결합의 아키텍처를 지원하여 단위 테스트를 더 쉽게
만들어 줄것이다.
캐슬 윈저?
캐슬 윈저는 IoC컨테이너로 ASP.NET MVC에서 잘 작동한다.
추상 형식(인터페이스)과 특정 구체 형식을 매핑하는 구성을 제공하고 그 후 누군가가
myWindosorInstance.Resolve<ISomeAbstractType>()를 호출한다면 캐슬 윈저는 현재 구성되어 있는 것과 일치하는
구체 형식의 모든 의존성 체인을 분석하면서 구성 요소의 생명주기를 고려하여 인스턴스를 생성한 후 반환할 것이다.
.NET MVC을 위한 캐슬 윈저 다운로드
http://castleproject.org/castle/download.html
.NET MVC에서 캐슬 윈저 적용하기.
http://docs.castleproject.org/Windsor.Windsor-tutorial-ASP-NET-MVC-3-application-To-be-Seen.ashx
참조]
The tutorial assumes no prior familiarity with Windsor, any other container or related concepts. However a sound knowledge of C# and some experience with ASP.NET (hopefully in its MVC incarnation) is required.
You can find the entire code for finished application on github.
IoC는 응용프로그램의 구성 요소들을 다른 구성 요소들과 분리할 수 있게 도와주는 소프트웨어 설계 패턴이다.
IoC 컨테이너는 구성 요소의 인스턴스를 생성할 때마다 자동적으로 해당 구성 요소의 의존성을 해석한다.
그 결과 만약 컨트롤러가 어떤 의존성을 가지고 있다면 IoC 컨테이너가 적절한 인스턴스를 제공해 주게 될 것이다.
이 작업은 구성 요소들 간의 의존성을 자연스럽게 분리해 주고, 더 약한 결합의 아키텍처를 지원하여 단위 테스트를 더 쉽게
만들어 줄것이다.
캐슬 윈저?
캐슬 윈저는 IoC컨테이너로 ASP.NET MVC에서 잘 작동한다.
추상 형식(인터페이스)과 특정 구체 형식을 매핑하는 구성을 제공하고 그 후 누군가가
myWindosorInstance.Resolve<ISomeAbstractType>()를 호출한다면 캐슬 윈저는 현재 구성되어 있는 것과 일치하는
구체 형식의 모든 의존성 체인을 분석하면서 구성 요소의 생명주기를 고려하여 인스턴스를 생성한 후 반환할 것이다.
.NET MVC을 위한 캐슬 윈저 다운로드
http://castleproject.org/castle/download.html
.NET MVC에서 캐슬 윈저 적용하기.
http://docs.castleproject.org/Windsor.Windsor-tutorial-ASP-NET-MVC-3-application-To-be-Seen.ashx
참조]
Introduction¶
This is introductory tutorial that will get you up to speed with using Windsor in a simple web application. The application is called To be seen and helps user collect information about upcoming movies, CDs, books, events etc, and set up reminders for when they come up.The tutorial assumes no prior familiarity with Windsor, any other container or related concepts. However a sound knowledge of C# and some experience with ASP.NET (hopefully in its MVC incarnation) is required.
You can find the entire code for finished application on github.
Tutorial¶
So far the following parts were published:Introduction¶
- Part One - Getting Windsor discusses downloading Windsor assemblies and adding them to your project
- Part Two - Plugging Windsor In discusses creation of custom controller factory
- Part Three - Writing Your First Installer discusses writing Windsor installer
- Part Three (a) - Testing Your First Installer discusses testing Windsor installers (validating conventions)
- Part Four - Putting It All Together discusses using all elements from previous parts to get a working application
Building the app¶
- Part Five - Adding Logging Support discusses using logging facility to add logging support to the application
- Part Six - Persistence Layer discusses creating custom facility and registering externally created objects, as well as setting up NHibernate
- Part Seven - Lifestyles discusses using different lifestyles, per-web-request in particular
- Part Eight - Satisfying Dependencies discusses how dependencies are resolved and what approaches there is to specify dependencies
- Part Nine - Diagnosing missing dependency issues discusses how to approach exceptions throw from the container
// more to follow
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 스프링 시큐리티(spring security)-http basic 인증
- 람다식(lambda expression)
- 인텔리제이(intellij)
- 진수 변환
- nl2br
- jstl(java standard tag library)
- 메이븐(maven)
- await
- React
- In App Purchase
- 문자 자르기
- REST API
- java web-mvc
- jstl(java standard tag library)-core
- 스프링 시큐리티(spring security)
- java 키워드 정리
- 스프링 프레임워크(spring framework)
- System.Diagnostics
- MainActor
- jsp 오픈 소스
- java.sql
- 표현 언어(expression language)
- java-개발 환경 설정하기
- 제품 등록
- system.io
- docker
- 특정 문자를 기준으로 자르기
- error-java
- .submit()
- 스프링 프레임워크(spring framewordk)
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함