How to rearrange classes and operations, Database Management System

Assignment Help:

Rearrange Classes and Operations

Sometimes, the similar operation is defined across different classes and can easily be inherited from a familiar ancestor, but more often operations in several classes are similar, but not the same. By slightly altering the definitions of operations or classes, the operations could often be made to match so that they could be covered by a single inherited operation. The following types of adjustments can be made to increase chance of inheritance:

  • We will find that some operations can have fewer arguments than others. The missing arguments can be added but normally ignored. Such as, a draw operation on a monochromatic display does not require a colour parameter, but parameter can be accepted and ignored for uniformity with colour displays.
  • Some operations can have fewer arguments since they are special cases of more common arguments. In this case, you can implement special operations by calling general operation with appropriate parameter values. Such as, appending an element to list is a special case of inserting an element; here the insert point just follows the last element.
  • Same attributes in different classes can have different names. Give attributes the same name and move them to a common ancestor class, then operations that access attributes will match better. Also, watch for same operations with different names. You should note that a reliable naming strategy is significant to avoid hiding similarities.
  • An operation can be defined on many different classes in a group, but be undefined on other classes. Define it on a common ancestor class and declare it as a no-op on classes which do not care about it. For instance, in OMTool the begin-edit operation places some figures, for example class boxes, in a special draw mode to authorize rapid resizing while the text in them is being edited. Other figures do not have special draw mode, so begin-edit operation on these classes has no effect.

 


Related Discussions:- How to rearrange classes and operations

Explain candidate key and super key, Explain Candidate Key and Super Key ...

Explain Candidate Key and Super Key A super key is a set of one or more than attributes that, taken collectively, permits us to identify uniquely a tuple in the relation. Wher

Critically evaluate the bulleted list of information, Critically evaluate t...

Critically evaluate the bulleted list of information-related items in this case study. How are each contradictory to the notion of being an information-literate knowledge worker?

Calculate the joint probability, Consider the following frequency counts o...

Consider the following frequency counts of some itemsets in a transaction database r : freq({A}, r) = 0.405 freq({B}, r) = 0.510 freq({C}, r) = 0.303 freq({A

What is foreign key, What is foreign key? A relation schema r1 derived ...

What is foreign key? A relation schema r1 derived from an ER schema may contain among its attributes the primary key of another relation schema r2.this attribute is known as a

Describe the primary key functions, Describe the primary key functions? ...

Describe the primary key functions? Primary Key : The primary key is an attribute or a set of attributes in which uniquely identify a specific example of an entity. Every entit

Need some database of usa and uk, I want Database Of United Kingdom with Cr...

I want Database Of United Kingdom with Criteria of:\r\n\r\n1). Name, Number, City, State, Postal Code, Address, Email id, DOB.\r\n\r\n2). Unsecure Debts only adds Credit Card Payme

Define the wait for graph, Define the Wait for graph Ans: The wait-for-...

Define the Wait for graph Ans: The wait-for-graph is a directed graph and consist of nodes and directed arcs; the nodes of the graph are active transactions. An arc of the grap

Difference among a database schema and a database state, What is the differ...

What is the difference among a database schema and a database state? The collection of information stored in database at particular moment in time is known as database state a

List the types of authorization, List the types of authorization. A) R...

List the types of authorization. A) Read authorization B) Write authorization C) Update authorization D) Drop authorization

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd