## 4 Technological Issues
### Event-Based Middleware Description  
The role of the middleware layer is to offer the best solution to easily deal with data integration. A good definition of middleware could be \"a layer of software that resides between the business application and the devices layer of heterogeneous platforms and protocols\" [22]. It decouples the business applications from any dependencies form the underlying layer, which consists of heterogeneous operating systems, hardware platforms and communication protocols. In other words, the presence of a middleware to build distributed systems relieves developers from knowledge of low-level details related to the network, like concurrency control, transaction management, network communication, so that they can focus only on application requirements. Some examples of middleware successfully used are: CORBA from the Object Management Group (OMG) [23], Microsoft COM [24], SUN Java RMI [25], IBM's MQSeries [26], and Remote Procedure Calls (RPCs) introduced by SUN in '80s.  
WhereX introduces significant perspectives to enterprise system integration, by extending the interoperability concept and by promoting new forms of collaboration; moreover, it is based on a careful management of context awareness, mobility and seamless connectivity. Its final goal is to provide a solution compliant to the use of Web services and able to provide multichannel communications.  
The purposes of the middleware can be summarized in: simultaneous management of many objects and readers, even with different technologies; management of many sensors placed on wide surfaces, not covered by previous infrastructures; high scalability to meet the requirements of modern and dynamic companies; on- and off-line interfacing with mobile devices.  
The architecture has been created by paying attention to functional modularity, and for this reason the use of the SOA philosophy has been fundamental also for the internal processes of the middleware [27]. This gives a high level of flexibility and scalability to the system. The main functional components of the middleware architecture are:* **Collection (Drivers and Hub):** they are two distinct components that implement two solutions (Direct and Logical entities) that both aim at data acquisition from physical devices; in the Direct solution the physical devices are directly interfaced/connected to the middleware via Ethernet, USB, RS232, Bluetooth, or any other interface;
* **Data Filtering (Filter):** it is the component that filters data, removes the data affected by errors, removes redundant data, and aggregates information;
* **Events Management (Rule):** its task is to generate customisable events, depending on specific conditions. This component enables the separation of the event management from the specific physical device generating the event itself;
* **Data Dispatching (Dispatcher):** it dispatches data to and from the components of the system, and to the applications outside the system; it arranges information for communicating with software applications interacting with the middleware. The most recent communication protocols supported by the middleware, improving its integration in enterprise systems, are HTTP, XMPP, JMS, WS, SMS and Database; they can even be simultaneously adopted, thus providing a powerful multichannel communication feature.
* **Data Storage (Local Repository):** it plays two important roles; storing the configuration parameters of the system and keeping the history of the data detected in order to perform statistic processing or to create business intelligence.
* **Middleware Configuration (Admin):** it provides the interaction tools for the system administration by a powerful console made through a user-friendly web interface.