![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 338 Pomógł: 2 Dołączył: 4.03.2006 Skąd: Łódź Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Co jest lepszym rozwiazaniem? Singletone, czy przekazywanie go obiektom? Dla przykladu:
Adrian. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 487 Pomógł: 7 Dołączył: 7.01.2004 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Ej, panowie, ale chyba znacie definicje Front Controllera prawda? Odpowiedzialność ciążąca na akcji powinna się sprowadzać tylko do wykonania pewnej operacji, cytując Fowlera:
Cytat("Patterns of Enterprise Application Architecture") In a complex Web site there are many similar things you need to do when handling a request. These things include security, internationalization, and providing particular views for certain users. If the input controller behavior is scattered across multiple objects, much of this behavior can end up duplicated. Also, it's difficult to change behavior at runtime. The Front Controller consolidates all request handling by channeling requests through a single handler object. This object can carry out common behavior, which can be modified at runtime with decorators. The handler then dispatches to command objects for behavior particular to a request. Padły tu tez jakies zdania o IoC, w Springu, który korzysta w pełni z IoC jest element, który pełni funkcję front controllera - jest nim DispatcherServlet (pakiet spring.web.servlet). Ten post edytował splatch 4.07.2006, 07:24:03 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 8.10.2025 - 03:44 |