- #1
SolarMidnite
- 22
- 0
For my Java programming course, I have been asked to create a class called Parliament & describe its key states and behaviours. I know that key states describe what an object is and behaviours describe what an object does. I've also been advised to base an object's state and behaviour by picking out nouns and verbs, respectively, from a description of the object (Parliament).
However, I am a bit confused about how to relate fields to methods. On the java tutorial page: http://docs.oracle.com/javase/tutorial/java/concepts/class.html, for the Bicycle class, the field gear is a key state, while the method changeGear is its corresponding behaviour.
So for the Parliament class, I researched the Canadian Parliament. Based on information from the following website: http://www.parl.gc.ca/About/Parliament/GuideToHoC/index-e.htm, are "Queen", "Governor General", "Senate" & "House of Commons" appropriate examples of key states? For Governor General, for example, would the appropriate corresponding method be "dissolving Parliament for an election" since this is an action taken by a Governor General? OR, would the key state instead be something like "executive branch" and its behaviour (method) "implement laws", or state: "legislative branch" and behaviour: "make laws".
I would really appreciate any clarification, as I am still awaiting a reply from my Instructor.
However, I am a bit confused about how to relate fields to methods. On the java tutorial page: http://docs.oracle.com/javase/tutorial/java/concepts/class.html, for the Bicycle class, the field gear is a key state, while the method changeGear is its corresponding behaviour.
So for the Parliament class, I researched the Canadian Parliament. Based on information from the following website: http://www.parl.gc.ca/About/Parliament/GuideToHoC/index-e.htm, are "Queen", "Governor General", "Senate" & "House of Commons" appropriate examples of key states? For Governor General, for example, would the appropriate corresponding method be "dissolving Parliament for an election" since this is an action taken by a Governor General? OR, would the key state instead be something like "executive branch" and its behaviour (method) "implement laws", or state: "legislative branch" and behaviour: "make laws".
I would really appreciate any clarification, as I am still awaiting a reply from my Instructor.