Created
December 23, 2012 04:43
-
-
Save danveloper/4362001 to your computer and use it in GitHub Desktop.
Example student entity for rules engine post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student { | |
enum DormHall { | |
Honors, Preferred, Normal | |
} | |
def firstName | |
def lastName | |
def gpa | |
// We only want dormHall to be assigned when it is deliberate, so throw an exception when | |
// it is accidentally assigned outside of our rules engine | |
private def dormHall | |
public void setDormHall() { | |
throw new RuntimeException("Student dorm hall is not directly assignable.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment