Struts is a popular open source Java technology framework for handling Web requests and page - flow coordination. In this example, partial SAD, I wish to illustrate a logical view in more detail.
Software Architecture Document Jakarta Struts Framework
The Struts framework - and subsystems built with it - reside primarily in the Ul layer of a web application. Figure illustrates noteworthy layers and packages with a UML package diagram.
Figure 1. Noteworthy layers and packages related to Struts
There is a distinction between pure Ul layer responsibilities, that encompass creating the content and pages for display, vs. what is sometimes called the application control layer - the layer of components that is responsible for deciding the flow of control, and directing the presentation layer to display something. In common use, web presentation frameworks usually imply the inclusion of application control responsibilities, which is also true of Struts, as it requires developers to create subclasses of the Struts Action class that are responsible for flow control decisions.
The Struts architecture is based on the Model - View - Controller (MVC) pattern; specifically, the web systems variant where the component roles are:
Controller :- a multithreaded singleton Facade - like object responsible for receiving and delegating HTTP requests, and by collaboration with other objects, controlling the flow of the application.
View :- components responsible for generating display content (e.g., HTML).
Model :- components responsible for domain logic and state.
Struts adoption of MVC provides the architectural foundation to achieve a separation of concerns related to flow control, display content generation (and formatting), and application logic - in this case through modularization into separate component groups that specialize by cohesively related responsibilities.
The specific MVC roles mapped to Struts components is illustrated in the UML class diagram in Figure.
Figure 2.MVC roles in Struts
The ActionServlet acts as a Facade onto the presentation layer. And although not a classic Mediator that receives and mediates messaging between other decoupled objects, it is similar, because an Action object returns an ActionForward object to the ActionServlet, which is used to direct the next step.
The Struts ActionServlet and Action design also illustrates the Command Processor pattern, a variant of the GoF Command design pattern. The ActionServlet plays the role of Command Processor, receiving requests and mapping them to Action (Command) objects that execute requests.
Struts demonstrates the Front Controller and Business Delegate patterns. The ActionServlet is the Front Controller, or initial point of contact for handling requests. The Action objects are Business Delegates - abstractions that delegate to the "business" or domain layer of services.
The Action objects also play the role of Adapters, adapting the framework calls to the interface of the domain layer objects.
As illustrated in the Figure, the ActionServlet implements the Template Method pattern: process is the template, and the processXXX are the hook methods.
Figure 3.Struts framework hotspots
Key to using a framework is knowing its hotspots - the variation points in the framework where the developer can parameterize or "plug in" applications - specific varying behavior, through techniques such as subclassing, composition based on interfaces, and declarative constraints or mappings usually externalized in configuration files. Figure illustrates key Struts hotspots, which use subclassing and declarative mappings, typical of whitebox framework designs.
UML Related Interview Questions
|Adv Java Interview Questions||Java collections framework Interview Questions|
|Design Patterns Interview Questions||Rational robot Interview Questions|
|Web semantic Interview Questions||Spring MVC Framework Interview Questions|
|Advanced C++ Interview Questions||Advanced jQuery Interview Questions|
|XML DOM Interview Questions||Object Oriented Analysis and Design Interview Questions|
Object-oriented Analysis And Design
Iterative, Evolutionary, And Agile
Inception Is Not The Requirements Phase
Iteration 1 Basics
System 'sequence Diagrams
Requirements To Design-iteratively
Logical Architecture And Uml Package Diagrams
On To Object Design
Uml Interaction Diagrams
Uml Class Diagrams
Grasp: Designing Objects With Responsibilities
Object Design Examples With Grasp
Designing For Visibility
Mapping Designs To Code
Test - Driven Development And Refactoring
Uml Tools And Uml As Blueprint
Iteration 2 - More Patterns
Quick Analysis Update
Grasp: More Objects With Responsibilities
Applying Gof Design Patterns
Iteration 3 Intermediate Topics
Uml Activity Diagrams And Modeling
Uml State Machine Diagrams And Modeling
Relating Use Cases
Domain Model Refinement
More Ssds And Contracts
Logical Architecture Refinement
More Object Design With Gof Patterns
Designing A Persistence Framework With Patterns
Uml Deployment And Component Diagrams
Documenting Architecture: Uml & The N+1 View Model
More On Iterative Development And Agile Project Management
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.