This article from the Code Project makes a neat explanation of the Subject.
First of all there's no stone-written way to model a domain, there are several ways that are correct modeling approach to a particular problem. For example, your initial example uses a Facebook
class and in your follow-up you're now using a Facebook Account
type: using one or another (or maybe both) has impact un your model but doesn't invalidate it.
Saying that, according to the Code Project site an association relationship implies:
- Owner: No owner
- Life time: Have their own lifetime
- Child object: Child objects all are independent.
With that in mind, I don't think there's an association relationship between User
and Facebook Account
since they're highly dependant from each other (assuming User refers to a Facebook user), so a composition might be a better relationship.
I'm not sure what are you refering with your Session
class. If it's the period of time while the user is connected there is no sense in saying Facebook uses session for authentication and maybe the asociation relationship between User
and Session
can be an agregation, since a User can have several Sessions in a day an it's the owner of all of them.