Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

pattern for large if - else set code

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody out there use a pattern for a large if-else set code
in Java?
I read an article in JavaWorld that's using Visitor pattern but
I felt that it's too complicated.
any comments would be appreciated in advance!
Cindy
 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
To remove conditional logic,Polymorphism GRASP Pattern could be used.The variations of Polymorphism (like State and Command pattern) has been explained with examples in Craig Larman,Applying UML and Patterns.

Hope this helps,
Sandeep
[This message has been edited by Desai Sandeep (edited June 14, 2001).]
 
Marshal
Posts: 15887
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cindy,
If possible, post some of the code that you want to refactor and maybe we can make some suggestions.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic