Parts of Speech Technique
In Abbot's linguistic analysis approach we identify the noun phrases and the verbs in the problem description or system specification to find the classes and their operations.
Verb extraction is used to find the methods. Identify the verbs in the problem statement. These are good candidates for the actions that must be performed by the classes to carry out its responsibilities.
Booch finds Abbott's method to be useful due to its simplicity and the fact that it forces the developer to work in the vocabulary of the problem space. The drawback is that the quality of the domain objects depends on the informal specification document. Coad and Yourdan suggest looking for key nouns and verbs in the widest possible variety of domain-related documentation, not just developer-generated domain descriptions.
Example for Parts of Speech Technique
Let us now see an example that illustrates the parts of speech technique for finding the domain objects. Consider the following statement of requirements for the first iteration of a Library System.
Books and Journals : The library contains books and journals. It may have several copies of a given book. Some of the books are for short term loans only. All other books may be borrowed by any library member for three weeks. Members of the library can normally borrow up to six items at a time, but members of staff may borrow up to twelve items at one time. Only members of staff may borrow journals.
Borrowing : The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above.
Requirements statement with noun and noun phrases in bold is shown below.
Books and Journals : The library contains books and journals. It may have several copies of a given book. Some of the books are for short term loans only. All other books may be borrowed by any library member for three weeks. Members of the library can normally borrow up to six items at a time, but members of staff may borrow up to twelve items at one time. Only members of staff may borrow journals.
Borrowing : The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above.
According to the Merriam-Webster dictionary, noun is something that is an entity, quality, state, action or concept.
Books, Journals, copies of a book are all entity therefore they are nouns and is in bold. Staff member and library member are noun phrases. Short term is an adjective. Loan can be a noun as well as a transitive verb. Loan is a concept in the above context. We don't have enough information about the loan concept in the description. From the description, we can say "Book is loaned to a library member". This will be modeled in the domain model as a relationship between the Book and LibraryMember with loaned to as the name of the association. Therefore we will eliminate it.
Here is a simple and easy way to find out if a given word is a noun or not. Go to Webster and just type in the word, the dictionary shows the meaning of the entry and also tells you if it is a noun or not.