Programming Languages

G22.2110 Spring 1998

 

Project - Part II

Due Date: 07/20/98

 

 

Project definition

 

Consider a simple object model involving the following entities: people, citizens, residents, students, teaching assistants, faculty members, and taxpayers. For the sake of this example, consider that people have a name, and date of birth, citizens have a social security number, and residents have an address in the United States. Clearly citizens and residents are people, but there may be people who are not citizens or residents. Students, teaching assistants, and faculty members are people; they may or may not be citizens, but must be residents. Finally, in order to be taxpayers people must be residents and work in the United States. Please answer the following questions. You can use Java to implement questions 3 and 4 instead of C++, and C++ instead of Java for question 5. Credit for each problem is as indicated. Please submit a project report by the due date. Your report should include a pointer to the directory containing your implementation files, or a diskette (if you are a Windows user).

 

  1. ( 10 points)
  2. Using inheritance ("is_a" relationship) and/or containment ("has_a " relationship), draw a class diagram that encompasses the entity relationships set forth in the above. Come up with a comprehensive set of features that further characterize the entities involved in the proposed object model. Please, explain your design choices.

     

  3. (10 points)
  4. Implement the class hierarchy derived in question 1 using C++, and Java. Your implementation should illustrate the use of encapsulation, inheritance, and polymorphism in C++ and Java. For either implementation, specify whether your derived classes are subtypes, and explain your implementation choices in details.

     

  5. (20 points)
  6. Based on your answer to question 2, design a C++ client program to interface the Student Registration Database server studied in project 1. You can treat a teaching assistant as a faculty member for a given semester. Your client should allow the creation, update and deletion of teaching assistant objects on top of the Student Registration Database server. You will need to provide a list or set iterator to help manipulate teaching assistant instances, and add the capability for users of your client program to request a list of teaching assistants. Please, explain in details all the modifications required to reuse the software provided (and possibly modified) as part of project 1. Suggested modifications may include makefile or IDL specification changes, new client or server software, etc. Please keep your changes minimal, and your design specification as concise as possible.

     

  7. (30 points)
  8. Implement the modifications suggested in question 3. You do not need to implement proposed modifications that would require substantial modifications to the IDL specification given for project 1. In other words, your C++ implementation can be a "prototype" of the full design suggested in question 3 (this also applies to question 5).

     

  9. (30 points)
  10. Based on your answer to question 2. Design and implement a Java client program that mimics the behavior of the C++ client program developed as part of questions 3, and 4.

     

  11. (Extra Credit 20 points)

Comment on the ease of implementation achieved via reuse, and the support provided by ILU.