1

Should i include classes that are part of the Java API, such as HttpURLConnection or JSONObject in my class diagram, or should i include only the classes that was developed for the project?

My Program connecting to a server, retrieving data, constructing a JSONObject then uses this data to construct some objects. I feel these classes are part of the flow, but I'm just using them - often, but just using - not inheriting or implementing an interface.

So, on one hand i feel they are important, on the other they are not part of my project as a contract or a super-class.

Thank You.

SnapDragon
  • 1,346
  • 2
  • 17
  • 32

3 Answers3

1

This of course goes with personal taste. But I personally tend not to include them. Or only refer to them by name but without the properties/methods listed to bring in the point that we don't control this class.

Sandro
  • 2,139
  • 4
  • 26
  • 41
0

If I looked at a system and felt like a class diagram would be important to have, I'd be inclined to take a step back and see if there are best practices that were missed, such as Prefer Composition over Inheritance.

But, if I was being forced to provide one, I would not include API classes in general, but only where absolutely essential.

Community
  • 1
  • 1
Don Branson
  • 13,430
  • 10
  • 57
  • 100
0

What do you want to achieve / communicate with your UML diagram?

Does including these classes help achieving that?

Look, there it is. Your answer.

Jens Schauder
  • 70,783
  • 26
  • 162
  • 317
  • I can see that you want to teach a guy to fish instead of handing him a fish. That's commendable. I'm trying to help you be more effective at it by suggesting that you reword your response to integrate the guidance provided in the FAQ. – Don Branson Mar 01 '12 at 19:53