Software Components & Services, an introduction

Creative Commons License
Software Components & Services, an introduction is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License
This lecture is an introduction to Software Components & Services. It is mostly illustrated by means of the Java EE platform and related technologies.
The full online tutorial on the Java EE platform and technologies can be found here
Canonical computing framework
Canonical computing framework
Client-server computing & middleware


Protocols are numerous and differ from their key main functionality and purposes: transport, security, data representation and exchange, Web…

Client/server computing (example)

Client/server computing (sample)

Three-tier architecture

Three-tier architecture paradigm

Three-tier Java application (sample)

Three-tier Java application (sample)

Technical services

Technical services are natively offered by middleware. Applications call for such predefined/pre-implemented services in order to avoid the development of their own policy for security, transaction management, etc.


For instance, EJBs can be endowed by security features to limit their access by third-party components/services. Security features are access roles and associated credentials.


For instance, Java Message Service (JMS) in Java EE or CORBA Event Service in CORBA allow asynchronous communication between components/services.

Timer services

For instance, timer services in the EJB technology (see below) can be requested in a uniform way by components/services. Such services in particular avoid the use of internal clocks. Typically, the Timer and TimerTask classes from Java SE have not to be used in Java EE because of distribution. This corresponds to the need for temporal data that are independent of each JVM (Java Virtual Machine) involved in distributed computing.

Transaction management

Java Transaction Service (JTS) is the introduction in Java of the Object Transaction Service (OTS) from CORBA. Java Transaction API (JTA) is a set of Java EE classes and interfaces to manage transactions among distributed components/services.

Application monitoring and control

JMX (Java Management eXtensions) is a Java SE technology to monitor Java applications: tracing, stopping, restarting, etc. The Java logging API is another service for application tracing.


Java Naming and Directory Interface (JNDI) is a Java SE technology to manage names of resources (e.g., message queues, data sources, URLs, computing units like components/services...) in distributed systems. This covers resource location search and resource binding to handle these resources in programs.




OSGi (Open Services Gateway initiative)

Service-Oriented Architecture (SOA)

Enterprise Service Bus (ESB)

An ESB eases the discovering and access to services in a business perspective (administrations, companies, divisions of companies, holdings...). It includes, for instance, service interoperability, both from a syntactical and semantic viewpoint through, in the second case, service mediation facilities. For example, the PETALS ESB is a Java platform for advanced SOA.

Towards SOA
Cloud computing
Cloud computing is the most innovative SOA application principle based on the now famous IaaS (Infrastructure as a Service), PaaS (Platform as a Service) and SaaS (Software as a Service) trio.
Big data
Big data refers to immense data sets generally produced by Internet devices, users... These data sets are characterized by a high scattering, even a deep dilution. Big data is associated with a set of devoted technologies like Map/Reduce (Apache Hadoop), NoSQL, etc.
Challenges in modern distributed computing
What is Java Enterprise Edition (Java EE)?

Java EE technologies

Java EE products

Java EE challengers: Django, Drupal, .NET, Spring, Node.js…

Java Application Model is here

Java EE 8 API (here)

The notions of “Component” and “Component-Based Development” (CBD)



Szyperski, C., Gruntz, D., and Murer, S.: “Component Software – Beyond Object-Oriented Programming”, Second Edition, Addison-Wesley (2002)
Software Engineering Institute, Carnegie Mellon University: “Volume I: Market Assessment of Component-Based Software Engineering” (May 2000)

Component-based software engineering

Component-based development cycle

Component-based development cycle

Component sorts

Component examples

Card reader in UML:

Card reader in UML

Currency in IDL:

module FbcCurrency {
    value Currency
    value Money;
    interface StateIdManager;
    interface CurrencyBook;
    exception FbcException {…};

Run indicator (as part of a programmable thermostat) in JavaBeans™:

public interface Run_indicator_client extends java.beans.PropertyChangeListener {…}

public class Programmable_thermostat extends … implements Run_indicator_client, … {…}

public class Run_indicator implements {
    public Run_indicator(Run_indicator_client programmable_thermostat) throws Statechart_exception {
        propertySupport = new java.beans.PropertyChangeSupport(this);
    public void off() throws Statechart_exception {
    private void setStatus(String newValue) {
        String oldValue = status;
        status = newValue;
        propertySupport.firePropertyChange("Run indicator status",oldValue,newValue);
Technical component models

JavaBeans™ Component Model (tutorial)

Enterprise JavaBeans™ (EJB)

CORBA Component Model (CCM)


Component Object Model (COM)

“Service” versus “component”


“Service”, discriminating characterization

Service vs component vs object

“Service”, an illustration

Timer services in EJB 3.x:
  • Service creation through resource injection:
    private javax.ejb.TimerService _timer_service = null;
  • A timer object is created for a specific usage, e.g., after 1000 ms, only one time, the my_business_method Java method (see below) is called:
    assert(_timer_service != null);
    _timer_service.createSingleActionTimer(1000L, new javax.ejb.TimerConfig("data passed to timed task", false));
  • The timed task:
    public void my_business_method(javax.ejb.Timer timer) {
        String s = (String)timer.getInfo();
        assert(s != null && s.equals("Data passed to timed task"));