where should we use a 'friend' class and when should inheritance be used?