-
Integration
- Adobe Document Service
- Enterprise Portal
- Business Graphics Server
- MS Office
-
CAF / Guided Procedures
- Entity Service Model
- Application Service Methods
- Integrating Web Dynpro applications with GP
- Visual Composer
- User Management Engine
-
Design Concepts
-
Model-View-Controller
-
Original idea
-
Invented by Trygve Reenskaug
- 1978, Xerox PARC
- MVC was the first design pattern that explicitly separated data presentation from data processing
-
How does the user perceive the information in the business process?
- What is the user's mental model?
- A "Model" represents the user's mental concept of the data
- An "Editor" manipulates the user's concept of the data I.E. the Model
- "Controllers" decide which view to show next and handle the business logic required to make the application function correctly
- Act is either generators or consumers
- With respect to Models, controllers are consumers
- With respect to Views, controllers are generators
- Model data is visualised through "Views"
- A "View" is always a consumer of data either from
- Another controller in the same component
- The client device (E.G. Keyboard, Mouse, Barcode Reader)
- A "Model" is always a generator of data
- Create software that duplicates the user's mental model
-
SAP's alterations to the original specification
-
Two categories of controller
- Non-visual
- Acts as a data consumer with respect to a model
- Acts as a data generator with respect to a visual controller
- Visual
- Always acts as a consumer of data
-
The "Component" concept
- Performs a similar role to that of the Editor in the original MVC pattern
-
Separation of data generators from data consumers
- Fundamental concept
-
Use cases
- Separating data processing from data presentation
- In Web Dynpro
- Visual controllers
- Always acts as data consumers
- Non-visual controllers
- Act as data consumers with respect to models
- Act as data generators with respect to visual controllers
- UI element binding
- Data generator role played by the visual controller's context
- Data consumer role played by the UI element property
- Context mapping
- Data generator role played by the mapping origin node
- Data consumer role played by the mapped node
-
SAP's design requirements
-
Overcome the limitations of existing web development tool sets
-
Difficult to achieve consistency of corporate look and feel
- SAP developed the concept of Unified Rendering
- Data presentation layer not sufficiently decoupled from the data processing layer
- Reuse is possible, but at a lower technical level, not at the business level
- Code reuse at a business level
- As much of the UI code as possible should be generated
- Declarative approach to defining an application's architecture
- Library of generic services for routine tasks
-
Karen Holztblatt
-
Focus Groups
- Grouping UI elements together in a manner that best captures the user's business requirements
-
The term "Focus Group" is not used explicitly within Web Dynpro
- This concept influenced the design of View Controllers
-
Content Administrator
- Usage Guide
-
User Interface
- Separated from the data processing layer by use of the MVC design pattern
-
Design time specification of UI elements is client agnostic
-
No client specific scripting is written at design time
- No HTML, JavaScript or CSS
- From NetWeaver CE 7.1 onwards, JSF and Flash Islands can be used to create custom UI elements
-
Client specific details are calculated at runtime
- UI element tree is defined in an abstract manner
- Server side rendering
-
Programming Model
-
The Web Dynpro Component
-
Fundamental Concepts:
- Building block for all applications
- Basic unit of reuse
- Basic unit of development
-
Aggregation of individual controllers
-
Visual Controllers
- Always fulfil the role of data consumers
- Types
- Interface View Controller
- NW 04 and NW 7.0
- Runtime implementation of a Window
- Shows only the subset of views required to form the current screen
- Known as a "View Assembly"
- Potentially changes after every server round trip
- Limited developer control
- Only navigation plugs and their implementation can be defined
- No access to this controller's context
- No standard hook methods available
- NW CE
- Defines the interface implemented by a Window Controller
- Window
- When declared, a corresponding Interface View Controller is created automatically
- Design time entity
- Navigation links between views are defined here
- Hard coded associations between inbound and outbound plugs
- Cannot be reassigned programmatically
- Defines the superset of all views to be displayed in the current window
- Manages an aggregation of views
- NW 04 and NW 7.0
- Only a design time entity
- No programmatic control available to the developer
- NW CE
- Has a distinct controller
- Programmatic control available to the developer
- View Controller
- Will only be visible if embedded into a Window
- Created only by explicit developer declaration
- Should only contain logic related to UI processing tasks
- Should not contain any processing related the business process
- Life span
- Framework Controlled
- A single instance persists for the duration of the component's life span
- When Visible
- A single instance persists only for so long as it is a member of the current View Assembly
- If removed from the View Assembly, the view controller instance is destroyed
- Manages an aggregation of UI elements
- View layout
- UI Elements
- Data supplied from local context by data binding
- Specified in a client independent manner
- No need to write HTML, JavaScript or CSS
- Window Controller (NW CE Only)
- A distinct controller for managing processing at the window level
- Can implement one or more interface view controllers
- Can be used to define abstract screen layouts
- Allows mapping definitions between actual embedded view containers and abstract view containers defined in an implemented interface view
- Instantiation
- On demand when required by the component's visual interface
- Automatic by the WD Framework
- All visual controllers are singletons with respect to the component controller acting as their parent
-
Non-visual Controllers
- Instantiation
- All non-visual controllers are singletons with respect to the component controller acting as their parent
- On demand when one of their methods is called by an:
- Explicit call in developer written coding
- Implicit call within the WD Framework
- Automatic by the WD Framework
- Fulfil the role of
- Data consumers with respect to a model
- Data generators with respect to a visual controller
- Types
- Component Controller
- This controller is the component itself
- Custom Controller
- Created only by explicit developer declaration
- Interface Controller
- Is an independent controller in NW04 and NW7.0 versions of WD
- Is a true interface in NWCE version of WD
-
Development process
-
Coding Tasks
- Manual coding
- Always placed between the //@@begin and //@@end comment markers
- Implementation of the business process within the generated framework created as a result of your declarations
- Input validation, error handling and navigation processing across multiple components must be designed into the application from the start
- Errors detected before or after navigation?
- Before: handle in wdDoBeforeNavigation()
- After: handle in wdDoPostProcessing()
- During a round-trip, child components must report errors up to their parent before the wdDoBeforeNavigation() method is reached.
- Do not blur the functional boundaries between controllers acting as suppliers of data and those acting as consumers
- Non-visual controllers generate the data consumed by visual controllers
- View controllers are consumers of data supplied to them from outside their own scope
- #1 error made by new WD developers is to place business logic (I.E. direct interaction with model objects) into view controllers. This results in applications that are difficult and costly to maintain
DON'T DO IT!
- View controllers handle:
- Reaction to user events in the UI
- Input validation.
- Invocation of business functionality found in other controllers
- Generated Controller Class
- Standard Hook Methods
- Interface between WD Framework and your own business logic
- Immutable
- Automatically called by the WD Framework during Phase Model processing
- Coding is generated based on design time declarations
- Typed access to the Context
- Method/Event Handler stubs
- Access to methods in other controllers
-
Declarative Tasks
- All Controllers
- Context Definition
- Hierarchical storage structure for controller data
- Defined at:
- Design time by explicit declaration
- Runtime by explicit coding
- Architecture
- Nodes
- Types
- NW 04 and NW 7.0
- Model
- Data type defined by being bound to a model object
- Mutable definition
- Model object created by the Model Wizard during the import process
- Enterprise Java Bean
- Web Service
- Adaptive RFC
- Java Bean
- Value
- User defined data type
- Data type defined by structure binding
- Immutable definition
- Structure defined in Java Dictionary either by:
- Model Wizard
- Manual declaration
- NW CE
- Universal Context Node
- No distinction anymore between previous "Model" and "Value" node types
- Explanation
- For Java programmers:
Node = Type-safe collection
- For ABAP programmers:
Node = Internal table possibly containing deep structures
- Properties
- Cardinality
- Selection
- Defines the maximum and minimum number of elements that may be flagged as "selected"
- 0..1
- Default
- Up to one element may be selected
- 1..1
- One element will always be selected
- 0..n
- Any number of elements may be selected
- 1..n
- At least one element will be selected
- Collection
- Defines the maximum and minimum number of elements the context node may contain
- 0..1
- The node may contain no more than one element
- 1..1
- The node will contain exactly one element
- 0..n
- Default
- The node may contain any number of elements
- 1..n
- The node will contain at least one element
- Supply Function
- No
- The node collection must be populated by explicit coding E.G. by binding it to a model object of a suitably structured vector object
- Yes
- The coding for the supply function must be written by the developer at design time
- Called every time the node is accessed if the contents is considered to be "dirty"
E.G. if the node has never been populated before
if the node has been invalidated
or if the lead selection in the parent node has changed
- Defined declaratively
- All "singleton" node must have a supply function defined for them
- Any context node may have a supply function
- Used to automatically populate nodes with data
- Called automatically by the WD Framework
- Disposer Function
- Yes
- NW04 and NW7.0 only
- Executed only if all conditions are met:
- Data has been changed via the UI - not programmatically!
- The internal event LeadSelectionChanged has been raised
- Once lead selection in parent node has changed, this cannot be undone or vetoed due to any errors being detected in disposer function
- NW7.1 only
- Executed unconditionally
- At the end of a controller's lifecycle, if disposer functions are defined for nodes in the context, they will be called after wdDoExit() has been processed.
- This can be overridden by forcibly invalidating such nodes in wdDoExit()
- No
- Any data held in the node will not be preserved if the node is invalidated
- Cannot be created declaratively
- Manually created subclass within a non-visual controller
- Must implement the abstract class IWDNodeCollectionDisposer
- Any node may have a disposer function
- Disposer functions should be written to work together with supply functions
- Gives you the chance to preserve node data before it is invalidated
- Called automatically by the WD Framework
- Structure/Model Class
- Type Access Required?
- Yes
- Default
- Switches on the generation of typed methods to make context coding easier
- No
- The data in the context can only be access using the generic context API
- Attributes
- Data type
- Any data type you like
- Cannot act as a data source for a UI element property
- Predefined SAP dictionary data type
- Can act as a data source for a UI element property
- Read Only?
- Yes
- Can be updated programmatically
- Cannot be updated via the UI
- This is typically used for calculated attributes
- No
- If this is also a calculated attribute, then consider the difficulties associated with writing a setter method!
- Calculated?
- Yes
- Need to write your own getter method
- Is the process implemented by the getter method reversible?
- Yes
- It is feasible to write a corresponding setter method?
- Do you really need a setter method?
- Is the implementation effort required to write a setter method worth the benefit it would provide?
E.G. You may have to write a complex text parser in order to reverse the functionality provided by the getter method
- No
- It will be impossible to write a corresponding setter method
- No
- Data is either stored directly in the context attribute or is derived via a mapping relationship
- Must be populated by an explicit assignment
- NW04 and NW7.0 only
- Data is never stored in a calculated attribute
- NW7.1 only
- Data is stored in a calculated attribute based on the value of the bufferMode property
- Unbuffered
- Data is never stored
- The getter method is called every time the attribute is read
- Make your coding as efficient as possible!
- Transient
- Data is stored after first call to getter method
- Stored data does not persist after a suspend/resume cycle
- Buffered
- Data is stored after first call to getter method
- Stored data is suspended along with the application and restored when the resume plug is fired
- Hierarchical structure
- Anchored to a "root" node
- NW 04 and NW 7.0
- Value node
- NW CE
- Universal Context Node
- Always has immutable properties
- Singleton
- Cardinality of 1..1
- Accessible via wdContext() helper method
- Child node can be a:
- NW 04 and NW 7.0
- Value node
- Model node
- NW CE
- Universal Context Node
- Recursive node
- Design time place holder
- The repeatedNode property must be configured to point to a parent node in the direct route back to the root node
- At runtime, an instance of parent node is created and occupies the place holder's position in the hierarchy
- Used to create structures whose depth is unknown at design time
E.G. file system directory structures
- Singleton property
- The usage of the term "Singleton" here refers to the number of child node instances with respect to the parent node in the context, not the Java VM
- Yes
- Only one instance of the child node exists at runtime - irrespective of the number of elements in the parent node's collection
- Default setting
- A Supply Function must be written for such a context node.
- Reduced memory requirements at runtime
- No
- For every element in the parent node's collection, there could be a distinct instance of the child node
- Non-singleton child node instances are only created if an attempt is made to read the data
- Increased memory consumption
- Required for displaying information in tree structures
- Space occupied at runtime
- Every node/attribute declared at runtime will have coding generated to define its existence at runtime
- Avoid unnecessarily large context structures
- typedAccessRequired = false can be used to stop the generation of the typed API coding for any particular context node
- Context node can now only be accessed using the generic API instead
- Reduces size of generated coding
- Makes context coding more awkward though -> generic API must be used
- The "byte code minimiser" will reduce generated code more efficiently than switching typedAccessRequired to false
- Removes un-referenced methods from the Java byte code
- Settings of "auto" or "wd-only" affect only generated WD classes
- Setting to "max" affects all Java coding in your application
- Do not use this setting if you use Java reflection!
- Context Mapping
- Mechanism for sharing data between controllers
- Mapped nodes are simply references to the data held in the mapping origin node
- Mapped nodes can maintain their own local selection information
- Mapped nodes may have local attributes added that store data locally
- Instance Methods
- Declared declaratively
- Normal methods
- Event handlers
- Usage Declarations
- Required before context mapping can be performed
- Causes a typed API to be created to give access to functionality in other controllers and/or components
- Visual Controllers Only
- Actions
- Defines the response to be taken when a client side event is triggered
- Is a distinct runtime object
- May be flagged as
- Enabled
- Any associated UI elements will be enabled
- Disabled
- Any associated UI elements will be disabled
- May be associated with multiple UI element events to form a generic event handler method
- The UI element must supply extra identifying information in order for the action event handler to be able to respond correctly
- May be defined as
- Validating
- Data supplied from the client must successfully pass dictionary validation before any further processing takes place
- Dictionary validation performed automatically
- Non-validating
- You don't care whether the data supplied from the client is valid or not
- E.G. When shutting down the application
- Dictionary validation is still performed, but WD Framework ignores validation error
- Plugs
- Inbound
- Outbound
- UI Layout
- No HTML, JavaScript or CSS need be written
- Hierarchical arrangement of UI elements
- Large number of UI Elements predefined
- Client independent definition
- User defined UI elements are not supported
- NW CE
- Flash Islands
- Embedded Java Server Face applications
- A UI element is any graphical entity that occupies a position in the UI Layout hierarchy
- Some UI elements may well be invisible!
- All UI elements are derived from the abstract base class of IWDUIElement
- All UI elements are the children of the "RootUIElementContainer"
- Of type "TransparentContainer"
- Immutable properties
- UI Element properties are supplied with data via "context binding"
- Almost all UI element properties can be bound to a context node or attribute
- E.G. the "id" property
- Such properties are defined as "not bindable"
- Data type of context node/attribute must match that required by the UI element property
- See package com.sap.ide.webdynpro.uielementdefintions
- See the packages in com.sap.ide.webdynpro.uielementlibraries.*
- Data to be displayed is not stored in the UI element object itself
- Context binding supplies data to the UI element property
- Data Supplier/Consumer principle at work here
- Fundamental concept in Web Dynpro development
- Do not try to call the setter method for each UI element property you wish to set.
Use context binding instead
- Position of UI elements controlled by the parent's Layout Manager
- Flow Layout
- UI elements "flow" from left to right
- If screen is resized, then the UI elements will be repositioned according to the new screen width
- No vertical alignment of UI elements
- Row Layout
- UI elements "flow" from left to right
- If screen is resized, then the UI elements will be repositioned according to the new screen width
- UI elements can be explicitly positioned at the start of new row
- No vertical alignment of UI elements
- Matrix Layout
- UI elements are positioned in rows and columns
- UI elements can be explicitly positioned at the start of new row
- Vertical alignment of UI elements into columns
- Unequal number of columns in each row is permitted
- Grid Layout
- UI elements positioned in a grid of fixed width
- Each row must have exactly the same number of columns
- NW CE
- Column Layout
- Maintains vertical alignment across multiple view containers
- UI Element types
- Simple
- UI elements that require no child UI elements
- Client Independent
- Content supplied by Web Dynpro server
- Button
- Input Field
- Label
- Text Edit
- Image
- etc...
- Content supplied by external Software
- Business Graphics
- Geo map
- Office Control
- BI Application Frame
- etc...
- Client Specific
- RFID Reader
- Barcode Reader
- Function Reader
- Composite
- All composite UI elements require "relation roles" with other UI elements in order to function correctly
- Table
- Will not function without at least one:
- Table Column
- This is also a composite UI element
- Column header
- Cell Editor
- A table UI element is considered to be an aggregation of columns, not an aggregation of rows.
- May also have:
- Table Header
- Grouped Column
- Legend Pop-in
- Master Column
- Pop-in
- Toolbar
- Cell Variants
- Tree
- Will not function without at least one:
- Tree Node
- Implement the onLoadChildren event
- Data for child node is only obtained when the user expands the tree node
- May also have:
- Tree Item
- Tree depth known at design time?
- Yes
- Static context structure can be used to supply data
- No
- Dynamic context structure must be used to supply data. I.E. recursive context nodes
- Non-singleton nodes must be used to supply data to a tree UI element
- Group
- Remember that a Group UI element already contains a child TransparentContainer UI element.
You don't need to add another one!
- Container
- Used to hold a subset of UI elements that may have their own layout manager
- Transparent Container
- IFrame
- Don't use an IFrame if it is to contain a stateful application obtained from a different server!
The remote application's state within the IFrame will be lost during a WD server round trip
- Tray
- Scroll Container
- View Container
- Pattern
- Contextual Panel
- Navigation List
- Pattern Sequence
- etc...
- Non-visual Controllers Only
- Events
- Trigger mechanism for invoking functionality in other controllers or other components
- Used for loose coupled communication between child components and their parent component
-
Runtime Data Storage
-
Context
- Used to decouple data storage entities (context nodes) from data presentation entities (UI elements)
-
Used to share information between different controllers
- Context Mapping
-
POJOs
-
Should be used when runtime data is not needed for display
- Lighter weight than context nodes
- Cannot be used for data that needs to be displayed on the client
-
Web Dynpro Application
-
A Web entry point to the functionality found in one or more Web Dynpro Components
- Via the interface view controller
- The component pointed to by the Application is known as the "root" component
- One component can have multiple applications
-
Invoked by calling a URL
-
Parameters can be:
- Added as a query string to the URL
- Hard coded in the application definition
-
Models
- Metadata definition
- Created at design time
-
Access to back end functionality
-
Web Service
- SOAP
- Open Standard
- Cannot adapt to changes that occur after design time interface is created
- This is because SOAP has no syntax for communicating field extensions
- FAQ on Adaptive Web Service Models
-
Adaptive RFC
- Remote Function Call (RFC)
- SAP specific protocol
- Highly efficient mechanism for invoking functionality in a remote ABAP system
- Implemented as jRFC.jar
- API to jRFC.jar has been greatly simplified by the JCo layer
- Can adapt to certain changes in the ABAP interface structure that occur after the design time interface was created
- .APPEND
- .INCLUDE
- Developer must code their application to look for changes in the interface, and then accommodate any differences
- Metadata cached within the SAP Java Server
- Adaptive RFC Cache
- Java Dictionary Cache
- Metadata Interface Cache
- Use of JCo Connections
- Same concept as SM59 logical destinations in R/3
- Quick Summary
- FAQ on Adaptive RFC Models
- Coding Guidelines
- Trouble Shooting
-
Java Bean
- Any class that has:
- A set of private attributes
- Getter and Setter methods to access the private attributes
- A public constructor requiring no arguments
-
Enterprise Java Bean
- Invoked by
- Direct execution
- Exposure as a Web Service
- Do not use this technique if WD application and EJB reside on the same server
- Communication protocol overhead incurred
- RMI
- Aggregation of classes
- Interfaces
- Descriptors
- Usage contracts
- Management contracts
- Types
- Entity Bean
- Container Managed Persistence
- Bean Managed Persistence
- Session Bean
- Stateful
- Stateless
- Message Driven Bean
-
Typically packaged into a specific Model DC
- Exposed via one or more Public Parts
- Ensures that the coding is compiled only once and then referenced
- Greatly speeds up the development process
-
Common Model Interface
- Gives all model objects a consistent interface irrespective of the underlying communication protocol
-
Interaction with NWDI
- Always use a DC of type "Web Dynpro"
-
Define the DC Metadata
- Functionality to be used outside the scope of the DC must be added to one or more Public Parts
- Declare use of Public Parts needed from other DCs
- Naming Conventions
- Mobile Devices
- Adobe PDF Documents
-
Other Information Sources
-
Books
- Inside Web Dynpro For Java
- Maximising Web Dynpro For Java
-
Training Courses
- JA310
- JA312
- SAP Developer Network
- SAP NetWeaver Library Documentation
-
Runtime Behaviour
-
Application Instantiation
-
The WD Framework examines lifecycle property of all components in the declared component hierarchy
-
manual
- Component instance must be created by explicit coding
-
createOnDemand
- WD Framework instantiates such components as soon as they are referenced - either by the Web Dynpro Framework or by an explicit method call
- wdDoInit() method called automatically
-
Client limitations?
- Certain UI elements are not supported by certain clients
- For instance, an standard browser does not typically support the use of the BarCode UI element
-
User Interaction
-
Event raised in the client device
-
Initiates round trip to server
- Initiates component instantiation if the application is being run for the first time.
- The associated action event handler method is called at the appropriate point in the Phase Model processing
- UI Elements must have an action associated with one of their events in order to trigger a round trip
-
Web Dynpro Framework
- Interaction with business application via a delegation layer
- Interacts with your business functionality through standard hook methods
-
Phase Model
- Phase Model in NW04 and NW7.0
-
Only handles round trip processing
- Client Abstraction Layer
- Remove incoming data from client specific container
- Client Independent Processing
- Before Navigation
- doApplicationStateChange
- Process resume request if present
- Perform Dictionary Validation
- Type of action determines whether subsequent processing takes place or not
- Validating action: respond to validation error
- Non-validating action: ignore validation error
- Call Service Event Handlers
- unload
- abort
- logoff
- valueHelp
- suspend
- NW CE
- ContextMenu
- NW CE
- doBeforeAction
- Application Event Handlers
- The action event handler method onAction${act} associated with the event raised in the client is called
- doBeforeNavigation
- wdDoBeforeNavigation() method called for all components in the hierarchy
- Always called using a top down traversal of the hierarchy
- In multi-component applications, navigation processing should be delayed until this point in time
- After Navigation
- Navigation and View initialisation
- Lifecycle management of view controllers takes place here
- Navigation queue processing takes place here
- Dynamic UI manipulation
- wdDoModifyView() method is called for all views in the new view assembly
- It cannot be predicted in which order this methods will be called for each view
- Retrieve data for UI tree
- For HTML clients, the entire screen is rendered
- Used to force all supply functions to execute during application processing
- doPostProcessing
- wdDoPostProcessing() method is called for all components in the hierarchy
- Methods are called using a top down traversal of the hierarchy
- In multi-component applications, the processing of serious or fatal error message should be managed by this method
- doApplicationStateChange
- Process suspend request if present
- Client Abstraction Layer
- Package output data into client specific container
- Server Side Rendering
- Generates the required markup and scripting instructions for the specific client device
-
Not directly responsible for component lifecycle management
- Handled by the WD Framework
-
Designing Large Web Dynpro Applications
-
Planning
-
Analyse the business process from different perspectives
-
Clock Maker Analogy
(See "Inside Web Dynpro for Java", section 3.4.11, page 111)
- Mayor
- Director of Public Services
- Clock Maker
-
Staff members
- Business Process Expert
- Management
- Board Members
-
Functional scope
-
Business process layer
- Re-engineered?
- Modified?
- Left untouched?
-
UI layer
- To existing business process?
- To modified business process?
- To re-engineered business process?
-
Access to business functionality?
- Web Services?
- ABAP via Remote Function Call?
- Java Beans?
- Some combination of these?
-
Design
-
Component Hierarchy
- n Tier design?
-
3 tier design?
- Typical structure
- Top level
- Master Component
- Component life cycle management
- Implements child components via standalone component interfaces for increased configuration flexibility
- Middle level
- UI Components
- Localisation functionality
- Integrate units of business functionality found in lowest level
- Tightly coupled to child components
- Low level
- Global Data Components
- Model Components
- Utility Components
- Know nothing of parent component implementation
- Loosely coupled to parents
-
Inter-component relationships
- Loose coupling in an upwards direction
- Tight coupling in a downwards direction
-
Focus on reuse
- Faceless components
- "Faceless" means that the component does not contribute to the business application's user interface.
This does not mean that the component has no user interface at all.
- Can have a UI for testing or admin purposes only
- Model Components
- Simplify access to complex business API's
- Utility Components
- This component type provides the only legitimate use case for external mapping
- Global Data Component
- Configuration Component
- Design time reuse
- Runtime reuse
- Referencing mode
- Individual component instances
-
Component granularity
- Too small
- Reuse not possible because one component does not contain enough functionality
- Results in a "sea" of functional fragments
- Excessively complex inter-component relationships
- Increased system overhead at runtime due to component instance management
- Correct
- Good reuse
- Minimum maintenance effort
- Effective distribution of work between team members
- Too large
- Poor reuse because components contain more functionality than required for the use case
- More complex interface
- More complex internal structure
- Distribution of work between team members difficult because component boundary spans several functional boundaries
-
Standalone Component Interface Definitions
- Different components share a common interface
- Multiple UI components required to front-end a single business processing component
-
Configuration Requirements
- Configuration held locally?
- Configuration held in a back end system?
- Configuration hard-coded into application parameters?
- Configuration received through URL query string?
-
Localisation Requirements
-
Multi-language UI required?
- If "yes", then build support in from the start
- Compliance required with country specific business laws?
- Country/Region specific UI layout required?
-
Location of business processing
- Back end SAP system?
- Web services?
- Enterprise Java Beans?
- Some combination of the above?
-
Implementation
-
Inter-component Communication
-
Context Mapping?
- Internal?
- External?
- Avoid complex mapping relationships between components
- Increased maintenance complexity
- Increased chance of unexpected behaviour
- Multiple components all updating the same node or attribute
- Unexpected changes in lead selection
- Consider a custom business object as a data transfer mechanism
- Pass values as parameters?
-
Event handling
- Loose coupling mechanism
- Upwards communication from child to parent component
-
Make correct use of standard hook methods
-
wdDoPostProcessing()
- Handling errors detected after navigation
- Round-trip method
-
wdDoBeforeNavigation()
- Handling errors detected before navigation
- Navigation processing
- Error Handling
- Round-trip method
-
wdDoModifyView()
- Only used for dynamic UI construction
- Don't modify the context here!
- Don't fire navigation plugs here!
- Don't try to get or set UI element properties!
Use context binding instead
- Round-trip method
-
wdDoInit()
- Lifecycle method
- Behaves like the controller's constructor
-
wdDoExit()
- Lifecycle method
- Behaves like the controller's destructor
-
Internal data storage
-
Memory Considerations
- Context?
- Typed access required?
- Byte code minimiser
- Model Objects?
- Custom Business Objects?
- Store or calculate?
-
Centralised functionality
-
Server-side caching of data?
- External Library?
- Service in the Engine?
-
Examples
- Message text management
- Help values
-
Management of child component instances
- On Demand
-
Manual
- Referencing mode?
- Child component instances used in referencing mode must be managed carefully!
- Root component should manage lifecycle
- Dynamic component usage
- Instantiate late
- Dispose early
-
Administration
- Runtime Environment
- Text Mapping
-
Background
-
Predecessors
-
Internet Transaction Server
-
Protocol translation tool for converting SAPGUI's proprietary DIAG protocol into HTTP based HTML pages
- Each SAPGUI dynpro could be represented by an HTML template
-
Originally a standalone server that sat between the ABAP system and the web server
- The web server needed a small plug in known as the "wgate" or "web gateway"
- The ITS functionality was implemented by a program known as the "agate" or "application gateway"
- Now embedded within the Basis layer of ABAP system
- Considered obsolete and only to be used for compatibility with legacy applications
- No new developments should be performed based on the ITS
- HTMLB
- Business Server Pages
-
Origins
-
Created from the need to remove the repetitive and error-prone nature of web development.
Tradition web development techniques created applications:
- That work perfectly with one browser, but then develop “unexpected features” when viewed in a different browser
- That require significant rework in the user interface layer because the structure of the business data changed
- In which short-cuts were taken during the design phase in order to get a quick result - only to find that the costs “saved” during development came back to haunt you during the maintenance phase
- The first concepts of Web Dynpro were discussed in 2001
-
Existing web development tools did not meet all of SAP's requirements, therefore a custom tool was written
- 1. Create a user interface (UI) programming paradigm that would become the standard for all future SAP software. Ease of use is the key here.
- 2. Eliminate the repetitive coding tasks currently experienced by Web developers. The fewer lines of hand written code there are in the UI, the better.
- 3. Make full use of abstract modelling. The application should not care about either the communication technology required to access a back-end system or the client technology used to render its screens.
- 4. Make full use of generic services. Functionality that is frequently required should be made available from a standard library of services. For example, if the user is asked to enter a date, then a date picker should automatically appear next to the input field without requiring extra coding effort on the part of the developer.
- 5. Use a declarative approach for application design. This approach is where the developer tells the development toolset what should be done, but not how to do it. This concept should extend into all areas of application design. (e.g., screen flow and component reuse).
- 6. Change the focus of software reuse from low-level units of code to high-level units that represent distinct steps in a business process.
-
Architectural Concepts
- Focus on component reuse
- Component Hierarchy
-
Faceless Component
- Provides no visual interface to the business application
- Simplifies the interface to a complex unit of back end functionality
-
UI Component
- Provides only the UI layer
- May handle input validation logic
-
Data Supplier/Consumer Concept
- Most fundamental concept in WD development
- Seen in multiple places and on different scales within the architecture
-
NW04 and NW 7.0 only
-
Dispatcher Component
- Handles navigation logic
- Sits in between the UI component and the faceless components in the hierarchy
- This type of component is no longer necessary in the Composition Environment version of Web Dynpro
- Superceded by functionality available in the new Window Controller
-
Division of Processing
-
Before Navigation
- All processing that takes place before navigation is concerned only with application business logic
- React to client side event
- Validate input from user
-
Call appropriate functionality in back end business system
- Do not do this from a visual controller!
Very bad style!
- Only from a non-visual controller
-
Handle errors and navigation requests
- Child components report errors up to the parent component
- Centralise error and navigation processing in the root component
- Fully populate the context with the data required for UI rendering
-
After Navigation
- Concerned only with constructing the new view assembly
- Treat the context as read only!
- Do not perform any business logic
-
If necessary, construct UI layouts dynamically
- Don't forget to check the firstTime parameter in wdDoModifyView()
- Any errors trapped after navigation should relate only to problems constructing the new view assembly.
- Use of External Libraries
-
NWDI
-
NWDI Component Model
- Hierarchical Structure
-
Product
- Very large unit of code
- Corresponds to an entire delivered SAP system
- Composed of one of more Software Components
-
Software Component
- The unit of software delivery, installation and upgrade
- An aggregation of Development Components
- One Development Component may belong to one and only one Software Component
-
Development Component
-
DC Types
- Composite Application Service
- Dictionary
- Java
- J2EE
- Enterprise Application
- EJB Module
- Web Module
- J2EE Server Component
- Library
- Interface
- Enterprise Portal
- Standalone Application
- Application Module
- UME Permissions
- Web Service
- Standalone Proxy
- Deployable Proxy
- Web Dynpro
- Always a member of a Software Component
-
Metadata wrapper around actual software functionality
- Determines how DC should be compiled and deployed
- Defines what internal functionality is exposed via the Public Parts
- Defines what functionality is consumed from other DCs
- Used for compilation, migration and delivery of software