What is the difference between an interface and abstract class?
- You cannot instantiate them
- They may contain a mix of methods declared with or without an implementation
|All fields are automatically public, static, and final, and all methods that you declare or define (as default methods) are public
||Can declare fields that are not static and final, and define public, protected, and private concrete methods
|Can implement number of interfaces
||Can extend only one class, whether or not it is abstract,
Abstract Classes Compared to Interfaces
Java EE Interceptors
Technology to do method call intercept. Common uses of interceptors are logging, auditing, and profiling.
Java EE Interceptor
target class – class in which Interceptors are defined. Interceptor methods are invoked in conjunction with the methods (of target class) or lifecycle events of the target class.
interceptor method – methods which handles the interceptor invocation. It could be defined in target class as interceptor method or defined in separate class called interceptor class.
interceptor class – contains interceptor methods
Interceptor Metadata Annotations
|Interceptor Metadata Annotation
||Designates the method as an interceptor method.
||Designates the method as a timeout interceptor, for interposing on timeout methods for enterprise bean timers.
||Designates the method as an interceptor method for post-construct lifecycle events.
||Designates the method as an interceptor method for pre-destroy lifecycle events.
XML Schema Definition – XSD Introduction
An XML Schema:
- defines elements that can appear in a document
- defines attributes that can appear in a document
- defines which elements are child elements
- defines the order of child elements
- defines the number of child elements
- defines whether an element is empty or can include text
- defines data types for elements and attributes
- defines default and fixed values for elements and attributes
XML Schema supports data types. With support for data types:
- It is easier to describe allowable document content
- It is easier to validate the correctness of data
- It is easier to work with data from a database
- It is easier to define data facets (restrictions on data)
- It is easier to define data patterns (data formats)
- It is easier to convert data between different data types
W3Schools XML Schema