Noun-Verb Decomposition Nouns Verbs Restaurant [Regular, Catering, - - PowerPoint PPT Presentation

noun verb decomposition
SMART_READER_LITE
LIVE PREVIEW

Noun-Verb Decomposition Nouns Verbs Restaurant [Regular, Catering, - - PowerPoint PPT Presentation

Noun-Verb Decomposition Nouns Verbs Restaurant [Regular, Catering, Take- has (information) Out] (Location, Type of food, Hours of operation, Reservations) Reservation Information Location Hours of operation Things SWEN-261 Account Introduction


slide-1
SLIDE 1

SWEN-261 Introduction to Software Engineering

Department of Software Engineering Rochester Institute of Technology

Noun-Verb Decomposition

Nouns Verbs Restaurant [Regular, Catering, Take- Out] (Location, Type of food, Hours of

  • peration, Reservations)

has (information) Reservation Information Location Hours of operation Things Account User [Diners, Logged-in, Guest, Restaurant] (Name, Rewards points, Password, Google login, Reservations) make (reservation) complete (reservation) saves (reservation) modifies/deletes/views (reservation) authenticate with (??)

slide-2
SLIDE 2

Using nouns and verbs provides a perspective for an initial class decomposition.

  • Nouns may represent
  • Classes
  • Specializations, i.e. subclasses
  • Attributes of classes
  • Data elements
  • Verbs may represent
  • Services a client needs
  • Services a server provides
slide-3
SLIDE 3

An analysis beyond a simple list of the nouns and verbs provides additional guidance.

  • Using structure and annotating the nouns and

verbs list moves you toward a class decomposition.

  • This helps yield a class structure that is

isomorphic to the world view of the problem similar to your domain modeling.

  • It also helps identify the location for

responsibilities.

slide-4
SLIDE 4

Restaurant Reservation System (RRS)

Each restaurant has information about its location, type of food, hours of

  • peration, and reservations. The restaurants are broken up into regular,

catering, and take-out where making a reservation means a different thing for each category of restaurant. Diners will be able to use the system either when logged into their account or as a guest. Diners, either as guests or logged in users, can make reservations. Reservations will be saved to a user's account if they are logged in. Logged in users can also modify or delete reservations in their account. A user's account will store a name, rewards points, and their upcoming and past reservations. Restaurant users will have an account which can view, modify, or delete any reservation made for their restaurant. The restaurant user can also complete a reservation when diners arrive. All users will authenticate using a password or Google login.

slide-5
SLIDE 5

Step 1 is to identify the nouns in the problem statement, domain, and user stories.

  • Make a list of all the nouns in the left column of

a two column table.

  • Put each noun in a table row.
  • You only need to list a noun once.
slide-6
SLIDE 6

Each restaurant has information about its location, type of food, hours of

  • peration, and reservations. The restaurants are broken up into regular,

catering, and take-out where making a reservation means a different thing for each category of restaurant. Diners will be able to use the system either when logged into their account or as a guest. Diners, either as guests or logged in users, can make reservations. Reservations will be saved to a user's account if they are logged in. Logged in users can also modify or delete reservations in their account. A user's account will store a name, rewards points, and their upcoming and past reservations. Restaurant users will have an account which can view, modify, or delete any reservation made for their restaurant. The restaurant user can also complete a reservation when diners arrive. All users will authenticate using a password or Google login.

RRS – Identify the nouns

slide-7
SLIDE 7

RRS – Identify the nouns

Nouns Verbs Restaurant Reservation Information Location Type of food Hours of operation Things Category of restaurant Diners Account Guest User Name Rewards points Password Google login

slide-8
SLIDE 8

Step 2 is to determine any specializations of the nouns that might exist.

  • Identify any words that might be specializations
  • f other nouns.
  • Put the specializing word in brackets [] next to the

noun it is specializing

  • If the word is a noun and has no other use than

this specialization remove its row in the table

slide-9
SLIDE 9

RRS – Identify specializations

Each restaurant has information about its location, type of food, hours of

  • peration, and reservations. The restaurants are broken up into regular,

catering, and take-out where making a reservation means a different thing for each category of restaurant. Diners will be able to use the system either when logged into their account or as a guest. Diners, either as guests or logged in users, can make reservations. Reservations will be saved to a user's account if they are logged in. Logged in users can also modify or delete reservations in their account. A user's account will store a name, rewards points, and their upcoming and past reservations. Restaurant users will have an account which can view, modify, or delete any reservation made for their restaurant. The restaurant user can also complete a reservation when diners arrive. All users will authenticate using a password or Google login.

slide-10
SLIDE 10

RRS – Identify specializations

Nouns Verbs Restaurant [Regular, Catering, Take-Out] Reservation Information Location Type of food Hours of operation Things Category of restaurant Diners Account Guest User [Diners, Logged-in, Guest, Restaurant] Name Rewards points Password Google login

slide-11
SLIDE 11

Step 3 identifies which nouns might be associated with other nouns.

  • Identify any associated nouns that might be
  • Attributes of other nouns
  • Properties of other nouns
  • Information/data owned by other nouns
  • Connect the nouns together
  • Put the associated noun in parentheses () next to

the noun it is associated with

  • Remove the associated noun's row only if it is a

primitive data type. Err in the direction of keeping nouns in the list.

slide-12
SLIDE 12

RRS – Identify associated nouns

Nouns Verbs Restaurant [Regular, Catering, Take-Out] (Location, Type of food, Hours of operation, Reservations) Reservation Information Location Type of food Hours of operation Things Account User [Diners, Logged-in, Guest, Restaurant] (Name, Rewards points, Password, Google login, Reservations) Name Rewards points Password Google login

slide-13
SLIDE 13

Step 4 expresses the use of each verb in a subject-noun verb object-noun form.

  • Identify all of the verbs
  • For each verb, express its use in a phrase of the

form

  • subject-noun verb object-noun

 subject-noun invokes the action  object-noun has the action done on it

  • Use the active voice for the verb
  • If it is in the passive voice, rephrase it
slide-14
SLIDE 14

RRS – Identify the verbs

Each restaurant has information about its location, type of food, hours of

  • peration, and reservations. The restaurants are broken up into regular,

catering, and take-out where making a reservation means a different thing for each category of restaurant. Diners will be able to use the system either when logged into their account or as a guest. Diners, either as guests or logged in users, can make reservations. Reservations will be saved to a user's account if they are logged in. Logged in users can also view, modify,

  • r delete reservations in their account. A user's account will store a name,

rewards points, and their upcoming and past reservations. Restaurant users will have an account which can view, modify, or delete any reservation made for their restaurant. The restaurant user can also complete a reservation when diners arrive. All users will authenticate using a password or Google login.

slide-15
SLIDE 15

RRS – Express verbs in subject verb object form

Restaurant has information Diners are able to use system Diners (users) make reservations Reservations will be saved (by the user? system?) User saves reservations to account User modifies/deletes/views reservations Restaurant user completes reservation Users authenticate with password or Google account (object-noun ??)

slide-16
SLIDE 16

Step 5 connects each verb to the nouns in the phrase expressing the verb's use.

  • Connect each verb to the subject-noun
  • Put the verb in the right column of the table row of

the subject-noun

  • Connect each verb to the object-noun
  • Put the object-noun in parentheses () to the right
  • f the verb
slide-17
SLIDE 17

RRS – Connect verbs to nouns

Nouns Verbs Restaurant [Regular, Catering, Take-Out] (Location, Type of food, Hours of

  • peration, Reservations)

has (information) Reservation Information Location Hours of operation Things Account User [Diners, Logged-in, Guest, Restaurant] (Name, Rewards points, Password, Google login, Reservations) make (reservation) complete (reservation) saves (reservation) modifies/deletes/views (reservation) authenticate with (??)

slide-18
SLIDE 18

Step 6 does grooming of the noun-verb table

  • If a noun has no attributes or specializations,

and does not invoke any verbs, consider eliminating it from the table.

  • Is there a verb missing that this noun invokes, or

expresses an action performed on this noun?

  • Is this noun really outside the system boundary?
  • If a verb is not invoked by anything, consider

eliminating it from the table.

  • Is there a noun missing that invokes the verb?
  • Is there a noun missing that has this action

performed on it?

  • Are some nouns synonyms?
  • Do some verbs have little relevance?
slide-19
SLIDE 19

Nouns Verbs Restaurant [Regular, Catering, Take-Out] (Location, Type of food, Hours of

  • peration, Reservations)

has (information) Reservation Information Location Hours of operation Things Account User [Diners, Logged-in, Guest, Restaurant] (Name, Rewards points, Password, Google login, Reservations) make (reservation) complete (reservation) saves (reservation) modifies/deletes/views (reservation) authenticate with (??)

RRS – Groom the noun-verb table

slide-20
SLIDE 20

Step 7 is creating a first-cut class decomposition.

  • Nouns in a table row (row-nouns) are potential

classes.

  • Nouns on the left in parentheses are potential

attributes of the row-noun.

  • Nouns on the left in brackets are potential

subclasses in an inheritance hierarchy with the row-noun as the superclass.

  • Verbs on the right are responsibilities potentially

defined in the object-nouns in parentheses.

  • A noun that is "responsible" for a verb action

contains the code that implements that action.

  • The implementation is typically in the receiver of

the action and not the doer.

slide-21
SLIDE 21

RRS – First-cut class decomposition

Classes Subclasses Attributes Responsibilities, i.e. implements the action Restaurant Regular, Catering, Take-Out Location, Type of food, Hours of operation, Reservations Reservation Make, complete, save, modify, delete, view User Diner, Guest, Restaurant Name, Rewards points, Password, Google login, Reservations Account Location Hours of Operation

slide-22
SLIDE 22

You now have another perspective for a starting point for your application's class structure.

  • This was created with a mechanical approach

from the nouns and verbs.

  • Everything may not make sense, e.g. Restaurant as a

class and also a subclass of User

  • You will reconcile this suggested structure with the

structure that your domain model motivates.

  • They should be very similar since they both derive

from the same information.

  • This mechanical approach provides additional

guidance for placement of responsibilities.

  • What is suggested here is not absolute and will be

subject to change and refinement.

22