Online social networks have become so pervasive in people's lives that they can play a crucial role in design and development processes of applications. At moment, a gap exists w.r.t standard networking programming to support social-network-based programming in large, according to software engineering principles of genericity and polymorphism. This drawback is made evident when applications should be built on top of multiple social networks and the user-centered vision should be kept. Indeed, heterogeneity of social networks does not allow us to produce software with suitable abstraction. In this paper, we cover the above gap by defining and implementing a model aimed at generalizing concepts, actions and relationships of existing social networks. The effectiveness of our approach is shown by two case studies. (C) 2015 Elsevier Inc. All rights reserved.