IntelliJ Java IDE
The moose likes OO, Patterns, UML and Refactoring and the fly likes pattern for large if - else set code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "pattern for large if - else set code" Watch "pattern for large if - else set code" New topic
Author

pattern for large if - else set code

Cindy Lyman
Greenhorn

Joined: Jun 14, 2001
Posts: 4
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
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
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).]


<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
Junilu Lacar
Ranch Hand

Joined: Feb 26, 2001
Posts: 3008
Cindy,
If possible, post some of the code that you want to refactor and maybe we can make some suggestions.

Junilu
[How to Ask Questions] [How to Answer Questions] [MiH]
 
IntelliJ Java IDE
 
subject: pattern for large if - else set code
 
Threads others viewed
Determine logical pattern for loop
Resultset caching causing heap dump
Using a Factory Pattern in a Web Based Application
Help with recursion
trim-directive-whitespaces - Seriously has anyone gotten this to work?
IntelliJ Java IDE