Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal: Working with Aggregate classes and Avoiding Security Issues. When writing an aggregate class, you should be careful not to unintentionally create security holes that

Goal: Working with Aggregate classes and Avoiding Security Issues. When writing an aggregate class, you should be careful not to unintentionally create "security holes" that can allow code outside the class to modify private data inside the class. In this example, the Course class is an aggregate class; it has instructor(a String) and a textbook (a Book) objects as fields. The UML Diagram for the Course class is below: + instructor: String + textbook: Book + Course(instr:String, bk:Book): Book is a class that has author (a String) and title (a String) as fields. The UML Diagram for the Book class is below: - author: String - title: String + Book(): + getAuthor():String + getTitle(): String + setAuthor(au:String): void + setTitle(ti:String): void You are given the partial definition of the Course class to modify. Define the constructor for the Course class. This constructor accepts two parameters, a String and a Book object. Use these parameters to initialize the instance fields, instructor and textbook. (NOTE: Do not worry about writing the definiton of the Book class. It has already been defined for you. You can call the methods in the Book class specified in the UML Diagram.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions