Chapter 14. Transforming Our UML Model into C# Code

It's now time to turn our attention back to the class diagram that we produced in Part Two of the book in order to develop a C# application based on that object-oriented (OO) blueprint. We'll step through all of the C# code necessary to automate a simple command-line version of the Student Registration System (SRS) application first, so that we may focus solely on what it takes to accurately model the SRS domain information in an OO programming language. Then, in the next two chapters, we'll round out our application by adding a means of persisting data from one session to another and a graphical user interface, respectively.

In this chapter, when we create the SRS domain classes, we'll translate into C# code the OO constructs you've learned about in the previous chapters of this book. In this chapter, you'll learn about the following:

  • Abstract classes, when we create the Person class as the base class for all of our "people" classes

  • Associations of varying multiplicities (one-to-one, one-to-many, and many-to-many), including aggregations; most of the SRS classes make use of associations

  • Inheritance relationships, when we derive the Student and Professor classes from the Person base class

  • Association classes, when we create the TranscriptEntry class

  • Reflexive associations, when we include class prerequisites to the Course class

  • Metadata, when we incorporate information relevant to different Section objects into the Course class

  • Static fields and methods, when we implement functionality into the TranscriptEntry class

In addition, we'll provide practical guidelines as to when to use these various constructs. We'll also cover a technique for testing your core classes via a command line–driven application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset