Question

Associate the following types of refactoring with prefactoring and postfactoring. Justify each decision. a. Move function...

Associate the following types of refactoring with prefactoring and postfactoring. Justify each decision.
a. Move function from one class to another 2 points
b. Extract superclass 2 points
c. Extract component class 2 points
d. Merge classes 2 points

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code Refactoring is a process of changing the structure of the code without changing the output.

a) Postfactoring

The functions are defined for what they should do.

Moving the function after function body definition is postfactoring.

b) Prefactoring

The actualization of method is required, and in order to represent the subclasses the superclass has to be modified. As the modification takes place before the actualization the superclass is prefactored.

c) Prefactoring

The code needs to be organized properly before implementing the methods. Thus, this is prefactoring.

d) Postfactoring

  After the class definition is completed , all the methods are fully implemented, then only the classes are merged. Hence, we call it postfactoring.

Add a comment
Know the answer?
Add Answer to:
Associate the following types of refactoring with prefactoring and postfactoring. Justify each decision. a. Move function...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 27. Suppose the unary ! operator is an overloaded member function of class String. For a...

    27. Suppose the unary ! operator is an overloaded member function of class String. For a String object s, which function call is generated by the compiler when it finds the expression Is? a. s.operator!0 b. s.operator!(default valuel, default value?,...) c. operator!(s d. A compiler error results because no arguments are given 28. Select the false statement regarding inheritance. a. A derived class can contain more attributes and behaviors than its base class b. A derived class can be the...

  • In this exercise, we will be refactoring a working program. Code refactoring is a process to...

    In this exercise, we will be refactoring a working program. Code refactoring is a process to improve an existing code in term of its internal structure without changing its external behavior. In this particular example, we have three classes Course, Student, Instructor in addition to Main. All classes are well documented. Read through them to understand their structure. In brief, Course models a course that has a title, max capacity an instructor and students. Instructor models a course instructor who...

  • Immunology Question 1 A) (1pt each) Associate each of the following characteristics of Dendritic cells with...

    Immunology Question 1 A) (1pt each) Associate each of the following characteristics of Dendritic cells with their stage development or activation (place appropriate letter after each characteristic). Immature DC prior to interaction with pathogen. Mature DC after interaction with pathogen. High levels of MHCII                                                  . High levels of phagocytosis                                       . Secretion of cytokines                                               . Expression of chemokine receptors                          . Low levels of CD80 expression B) What complement component represents the point in the complement cascade where...

  • plz write if it is in another class or package Question 1: 1. Create a new...

    plz write if it is in another class or package Question 1: 1. Create a new project in Eclipse (File > New > Java Project.) Name it Homework2Q1 2. Create a package for your classes 3. Create an abstract superclass with only non default constructor(s) 4. Create two different subclasses of that superclass 5. Create another class that is not related (you need a total of four classes up to this point) 6. Create an interface 7. Make the class...

  • Python programming Part VI: Move Starman by Movement Commands (20 points) Write a function move ()...

    Python programming Part VI: Move Starman by Movement Commands (20 points) Write a function move () that takes the following arguments, in this order I. board: A game board. 2. movement: A string that represents what kind of movement that Starman needs to perform. Four move ment commands are listed below: . 'U' : go up one row ·"D": go down one row : go left one column "R": go right one column Nole: You may assume that the movement...

  • QUESTION 11 Which of the following could never be found in the file NewClass.java? public NewClass()...

    QUESTION 11 Which of the following could never be found in the file NewClass.java? public NewClass() { message = “Hello World!”; } public String title = “New Class”; public void doSomething() { doSomethingElse(); } public OtherClass() { message = “Hello, World! Good to see you again!”; } 2 points    QUESTION 12 Match the terms to the corresponding definition below.       -       A.       B.       C.       D.       E.      ...

  • java. Question 3: The payment transaction scenario could be represented by the following hierarchy: Payments VISA...

    java. Question 3: The payment transaction scenario could be represented by the following hierarchy: Payments VISA MASTERCARD Paypal Create Payments as a superclass and VISA, MASTERCARD, PAYPAL as subclasses Create an interface PaymentsInterface with one method called payment Info. Create classes VISA, MASTERCARD, PAYPAL that implement Payments For each of the three classes (VISA, MASTERCARD, PAYPAL), create one constructor Constructors are used to create objects with initial balance with US dollars (USD). The interface class method "paymentinfo" should be overridden...

  • 13] Use UML notations to describe the following classes and their relationships. Define relevant private data,...

    13] Use UML notations to describe the following classes and their relationships. Define relevant private data, and the public methods for each class. a) Define a class Person that defines a generic person. b) Define a class Card that define a generic card c) Define a derived class from Person that describes a typical Student. d) Define a derived class from Card that describes a typical Student Card e) Define a derived class from Card that describes a typical Credit...

  • In Java Which of the following statements declares Salaried as a subclass of payType? Public class...

    In Java Which of the following statements declares Salaried as a subclass of payType? Public class Salaried implements PayType Public class Salaried derivedFrom(payType) Public class PayType derives Salaried Public class Salaried extends PayType If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method. False True When a subclass overloads a superclass method………. Only the subclass method may be called with a subclass object Only the superclass method...

  • 2 (a) Discuss the general features, the capabilities and the limitations of one of the following...

    2 (a) Discuss the general features, the capabilities and the limitations of one of the following classes of processes for the production of of engineering components. Illustrate your answer with reference to one specific technique taken from that class. [10 marks] (i) (ii) (iii) (iv) Casting (and moulding); Forming; Powder processing; Fabrication. (b) Using your choice of class from part (a), what types of materials are suitable for processing, in what form and why is there this restriction? [4 marks]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT