Object oriented implementation of distributions