Which design feature should you choose?

You create Web-based client applications. You are creating a component named Product. The component will represent data in the products table of a database. The ProductID field is the primary key of the products table. The Product ID is an integer value that is generated by the database. The products table contains two fields named ProductName and CurrentPrice, which do not accept null values. You need to design an interface for the Product class. You also need to ensure that upon instantiation the component will either retrieve an existing product from the database or add a new record to the products table. Which design feature should you choose?

You create Web-based client applications. You are creating a component named Product. The component will represent data in the products table of a database. The ProductID field is the primary key of the products table. The Product ID is an integer value that is generated by the database. The products table contains two fields named ProductName and CurrentPrice, which do not accept null values. You need to design an interface for the Product class. You also need to ensure that upon instantiation the component will either retrieve an existing product from the database or add a new record to the products table. Which design feature should you choose?

A.
The constructor includes a Boolean parameter named CreateNew and an integer parameter named ProductID.

B.
The constructor is overloaded such that one version includes a ProductID parameter and another version contains no arguments.

C.
The constructor is overloaded such that one version includes a ProductID parameter and another version includes ProductID, ProductName, and CurrentPrice parameters.

D.
The constructor is overloaded such that one version includes a ProductID parameter and another version includes ProductName and CurrentPrice parameters.



Leave a Reply 0

Your email address will not be published. Required fields are marked *