0

This may be a weird question, but is there anything wrong, methodologically speaking, about how I'm using enums here (See the Operation enum)?

https://github.com/NicholasRoge/jrpgme/blob/master/src/roge/utils/Math.java

Like I said, it's an odd question, but it just looks so... Odd, to me. I had the idea one night, and it worked out perfectly.

Edit: Someone told me to look at the interpreter design pattern, so I have. It's exactly what I'm trying to do. rofl. SO I'll likely be switching my code over to that pattern. However, I still very much welcome your input.

Nicholas Roge
  • 160
  • 2
  • 12
  • I don't think the idea is odd - however having 2 parameters for operations that only require one (SIN, COS etc) does look weird. This question would be a better fit for codereview.stackexchange.com. – assylias Jul 13 '12 at 14:48

1 Answers1

3

This is a bit unusual, but that doesn't make it wrong. In fact, it looks like a clear, clean and concise way of implementing the operators. That makes it good programming style in my books.

If there are concerns, they are at the level of issues with the domain modelling, rather than the use of enum types.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216