Problem Set 1 1. Classify the following into generalization, association, aggregation, or composition: a. A country has a capital city b. A dining philosopher uses a fork c. A file is an ordinary file or a directory file d. Files contain records e. A polygon is composed of an ordered set of points f. A person uses a computer language on a project g. A class can have several attributes h. A relationship can be an association or a generalization i. A student takes a course from a Professor j. A course has registrants 2. With concrete examples, study the implications of the following tradeoffs: a. Association versus generalization b. Aggregation versus association c. Single inheritance versus multiple inheritance d. Class inheritance versus object composition 3. Find an appropriate many-to-one matching from the left items to right items: 1. Abstraction A. Structural relationship 2. Encapsulation B. Hierarchy 3. Inheritance C. Implementation 4. Interface D. Business objects 5. Persistence E. Observable behavior of objects 6. Aggregation 7. Information hiding 8. Association 4. For each following task, state whether it is relevant for analysis (A) or for design (D) or for both (AD) 4.1. Decide a software architecture for the given application 4.2. Choose the window classes for the GUI 4.3. Develop Use Case Diagrams 4.4. Write down sequence diagrams for use cases 4.5. Write down a state diagram describing the steps of an algorithm 4.6. Remove a use case from the use case diagram 4.7. Use a stereotype 4.8. Select a data structure 5. Prepare a class diagram showing appropriate relationships (association, aggregation, generalization, etc.) in UML notation between the classes given. IISc, director, employee, faculty, instructor, student, library, hostel, department, research-advisor, research student, course student 6. Identify classes and create a class diagram for the following. A B2B Call Market (B2BCM) allows trading between buyers and sellers. Buyers describe products they wish to buy and place bids. Sellers describe products they wish to sell and place offers. The system, i.e. B2BCM looks at the bids and offers and determines a matching between buyers and sellers. A trader may also be both a buyer and seller (that is, buys some products and sells other products). 7. All of you know about amazon.com. Suppose you are required to design the software for amazon.com (i.e. users creating a shopping-cart of books, placing an order, making a payment, etc.). Identify 10 important classes for this system and create a class diagram depicting interesting relationships among these abstractions. 8. Create an XML Document that describes the content of the Ecommerce course. - where it is offered - who is handling - Timeframe - Objectives - Topics 9. Can you create a generalized template for the above question which can be used for any course? 10. What does it take to take this data (many such documents) to present it on a web browser? 11. Write a Java program to take 5 such documents, and print a report (a simple table) that works? Table example COURSE WHO NO:OF TOPICS DURATION