Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Class - Key States & Behaviours

  1. Sep 3, 2012 #1
    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.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted