-1

I am working on a class diagram for a forum and I got some questions about classes' operations. In fact I don't know where should i put the operations

In my diagram a "pseudo" can create a topic. In my first solution. I put the operation createTopic() in the class pseudo, because he's the "actor" of this action

Solution 1 But after some thinking another way seems also coherent. I could remove the operation createTopic() from the Pseudo Class and create an operation on the class topic: create()

Solution 2 Where solution should I pick ? Do you have some rules or some "sentence" to use in order to decide what is the right solution to pick ?

Thank you very much guys

aldo
  • 11

1 Answers1

1

If you are going to create a new Topic instance, that can definitely not be in Topic itself. It's rather a method in pseudo (you should keep naming conventions an start that with an upper case P) which invokes new on Topic and puts that somewhere in a collection inside pseudo.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86