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.

Ari M
  • 1,386
  • 3
  • 18
  • 33

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,219
  • 4
  • 27
  • 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,631
  • 10
  • 59
  • 101
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
  • 77,657
  • 34
  • 181
  • 348
  • 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