Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need at least an example in Python of where to even start with this. There has to be different classes for each of these

I need at least an example in Python of where to even start with this. There has to be different classes for each of these that are all subclasses to the HTMLTag. It's making no sense at all to me. I understand how classes in general work but what's being asked is far beyond anything that we've done in class to this point.

image text in transcribed

In this programming exercise, you are going to create an abstract data type that represents the HTML

tag along with all the other classes, their attributes, and methods as illustrated in the following UML class diagram. The class diagram for this assignment is as follows:

The HTMLTag class is defined so it has html attribute, an id attribute, and get_html method.

All other classes shown are derived from this base HTMLTag class. This means they inherit the attributes and the method, but they will override the attribute to return specific html string defined by each subclass.

Each subclass has additional attributes as shown in the diagram.

You need to provide a setter and a getter method for each of these attributes (not shown in the diagram). For Input subclass, as an example, you should have get_type(), set_type(), etc.

The Form class can act as a container and can have multiple additional attributes of the other subclasses as shown in the diagram.

You will need to override the get_html() for each subclass because it returns an html string thats not known until you instantiate an specific object of each subclass setting its attributes appropriately. See examples below.

Notice that the subclass Select can also act as a container for one or more of Option subclass objects. You need to account for that as well.

You need to use the factory method design pattern to create instances of any of these classes.

You need to consult the links from base link I cited above to get the details of the other attributes and what they are supposed to contain. Except you will use HTMLTagFactory()and use create_HTMLTag(html_type) instead.

Option HTMLTag +disabled +label +selected +value +html +text +get htmlO _init id) Select -name +multiple trequired +set_select_options (options) Label +for +form Form Input Button Textarea Paragraph +align +type tname +value +action +method name +target +disabled +name +type +value +formmethod +formtarget rows +cols +get_action0 +get_methodo +get_name0 +get_target0 +set_action0 +set_method0 +setup_form_content(list)

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

Students also viewed these Databases questions