SCA and Java SCA provides support for multiple Java- based component implementation types Java POJOs (implementation.java) Spring Beans (implementation.spring) EJB (implementation.ejb) Common annotations and API May be used by all Java-based implementations Metadata service contracts based on Java interfaces Metadata component type information Metadata container-component implementation contract Asynchronous interactions and callbacks APIs (few) for accessing assembly information
23
Embed
SCA and Java n SCA provides support for multiple Java-based component implementation types l Java POJOs (implementation.java) l Spring Beans (implementation.spring)
Key Principles n Simplify component development l Use POJOs l Minimal container coupling to implementations l Achieved through Inversion of Control or IoC n Simplify reuse through service-based design l Strongly defined contracts that pass data l Remove need to interact directly with binding protocols and transports most of the time l Focus on loosely-coupled interactions
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SCA and Java SCA provides support for multiple Java-based
Common annotations and API May be used by all Java-based implementations Metadata service contracts based on Java interfaces Metadata component type information Metadata container-component implementation
contract Asynchronous interactions and callbacks APIs (few) for accessing assembly information
An example Java implementation type Just Java with a few (optional) annotations
public class LoanServiceImpl implements LoanService {private CreditService creditService;public LoanServiceImpl(@Reference CreditService creditService) {this.creditService = creditService;}
public void apply(Application application) {String id = application.getCustomerID();int rating = creditService.getCreditScore(id);}
}
Key Principles Simplify component development
Use POJOs Minimal container coupling to
implementations Achieved through Inversion of Control or IoC
Simplify reuse through service-based design
Strongly defined contracts that pass data Remove need to interact directly with binding
protocols and transports most of the time Focus on loosely-coupled interactions
Metadata for Service Contracts @Remotable
Defines a service that may be visible across process boundaries
@Conversational, @EndsConversation Deals with conversational services More on this later
@OneWay Denotes a non-blocking operation More on this later
@Callback Defines callback interface and injection
Metadata for defining component type information @Service
Defines services offered by an implementation @Property
Identifies a component type property Setter-based, ctor-based and field-based injection
supported @Reference
Identifies a component type reference Setter-based, ctor-based and field-based injection
supported SCA defines heuristics for unannotated POJOs