  Internet of Things (IoT) has become the buzzword for the development of Smart
City and its applications. In this context, development of supporting software
forms the core part of the IoT infrastructure. A Middleware sits in between the
IoT devices and interacts between them to exchange data among the components of
the automated architecture. The Middleware services include hand shaking, data
transfer and security among its core set of functionalities. It also includes
cross-cutting functional services such as authentication, logging and caching.
A software that can run these Middleware services requires a careful choice of
a good software modelling technique. Aspect-Oriented Programming (AOP) is a
software development methodology that can be used to independently encapsulate
the core and cross-cutting functionalities of the Middleware services of the
IoT infrastructure. In this paper, an attempt has been made using a simulation
environment to independently model the two orthogonal functionalities of the
Middleware with the focus to improve its modularity. Further, a quantitative
measurement of the core design property of cohesion has been done to infer on
the improvement in the reusability of the modules encapsulated in the
Middleware of IoT. Based on the measurement, it was found that the modularity
and reusability of functionalities in the Middleware software has improved in
the AspectJ version compared to its equivalent Java version.
