The smart grid can be seen as a hybrid system composed by many systems. From a large scale point of view, it combines the electric power system itself and a heterogeneous information and communication technology (ICT) infrastructure. Additionally, these systems are composed by many building blocks that are designed and managed as separated systems which are hard to fully integrate between each other. Relying on the experiences arisen and the knowledge gathered from the partners during the development of the FP7 European projects INTEGRIS (intelligent electrical grid sensor communications) and FINESCE (future internet smart utility services), this paper presents the software defined utility (SDU) concept for the management of the smart grid and its security, which advocates for the migration of the utility infrastructure to software systems instead of relying on complex and rigid hardware based systems. Following this approach, SDU proposes the evolution of power systems' ICT and the usage of programmable commodity hardware, low-cost sensors, and reliable high-speed IP-based communications underneath. More concretely, this paper proposes some building blocks for the deployment of the SDU (flexible data management infrastructure, context-aware security and web of things interface) and evaluates their functionalities and benefits for the smart grids of the future.