Object Oriented Programming using C#

(backadmin) #1

Object Oriented Programming using C#
Case Study


Synonyms


The following are synonyms :-


•    Nouns:


  • LCD message display board = display board

  • scrolling text message = message

  • ID number = ID

  • credit units = client’s credit = credit

  • set of current messages = message set

  • days = number of days = days remaining


•    Verbs:


  • show = display


By identifying synonyms we avoid needless duplication and confusion in the system.


Potential Classes, Attributes and Methods


Nouns that describe significant entities for which we can identify properties i.e. data and behaviour i.e. methods could
become classes within the system. These include :-
• Client
• Message
• ClientBook
• MessageSet
• DisplayBoard
• DummyDisplayBoard


Nouns that are would be better as attributes of a class rather than becoming a class themselves :-
• For a ‘client’:



  • ID

  • name

  • address

  • phone number

  • credit
    • For a ‘message’:

  • text

  • days remaining

  • cost of message


Each of these could be modelled as a class (which Client or Message would have as an object attribute), but we decide
that each of them is a sufficiently simple piece of information that there is no reason to do so – each one can be a simple
attribute (instance variable) of a primitive type (e.g. int) or library class (e.g. String).

Free download pdf