• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should I use Chain of Responsibility in mode choose?

 
Paulo Diogo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is a good choice use Chain of Responsibility in mode choice? Will I add complexity unnecessary in the project or it's does not matter?


mode = client mode, alone mode or server mode
 
Roel De Nijs
Sheriff
Posts: 10444
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Extra complexity should always be avoided, simplicity is king! Because extra complexity means more code, more code means more (chance of) bugs, more maintenance cost,...

I don't see why you would use chain of responsibility in mode choice Because mode parameter is passed as a command line parameter to main method
 
Paulo Diogo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Extra complexity should always be avoided, simplicity is king! Because extra complexity means more code, more code means more (chance of) bugs, more maintenance cost,...

I don't see why you would use chain of responsibility in mode choice Because mode parameter is passed as a command line parameter to main method


I passed the mode for the chain... but you are right... I will use a simple factory
 
Roel De Nijs
Sheriff
Posts: 10444
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what are/were you trying to achieve with the chain? Creating the user interface? Processing a request? Or something else?
 
Paulo Diogo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:But what are/were you trying to achieve with the chain? Creating the user interface? Processing a request? Or something else?



I received the param and passa to chain...



I changed to factory...


 
Roel De Nijs
Sheriff
Posts: 10444
137
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paulo Diogo wrote:I changed to factory...

Very good decision Chain of Responsibility isn't intended for this purpose.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic