The moose likes OO, Patterns, UML and Refactoring and the fly likes Functional Calc Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Functional Calc" Watch "Functional Calc" New topic
Author

Functional Calc

Sree Shan
Greenhorn

Joined: Oct 12, 2000
Posts: 8
How can the patterns be applied to a Functional Calculator application, where a mathematical equation needs to be created, modifed and executed when the parameter values are made available?
Seems like this requires mixing Strategy, Visitor, Interpreter patterns... Has anyone tried this kind of an application? Can you suggest the best suited pattern(s) for a Calculator?
Thanks in advance.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi,
I am not sure of about the patterns you mentioned, but I think the Command Pattern might be helpful in this case.
You can have a Command Interface for say Mathematical functions with an execute() method.The GUI Presentation class would pass the Command to the Controller, which would create a Command instance corresponding to the event message forwarded.There would be a Command class for each type of possible Mathematical command/function.This class would override the execute() method polymorphically which is defined in the Command interface.
Hope this makes sense.
Sandeep


<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>
 
IntelliJ Java IDE
 
subject: Functional Calc
 
Threads others viewed
Adding an Executable to JFrame
Just passed SCWCD - 88%
Importance of Math class in SCJP 5.0
Help with calculator
incorporate dos application in win 32- bit application
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture