Running head: discussion question

Download 24.96 Kb.
Size24.96 Kb.
Discussion Question


Discussion Question

Student Name
Course Name
Instructor Name
May 31, 2020

Discussion Question

An abstract class is a generic description of a class (category of objects) structures and variables which comprises one or more abstract methods. Abstract classes have been used in all the languages for object-oriented programmings (OOP), such as C #, Java, C++, and VB.NET. Classes or objects can be derived, meaning they are condensed into features that are important to the operation of the current system. Specific class-derived instances are objects.
An abstract class comprises abstract attributes, which is non-implementable methods. In this manner, an abstract class can describe a comprehensive programming interface, thus giving method definitions to its subclasses for all the methods required to accomplish that programming interface[ CITATION Rou20 \l 1033 ]. Take the example of when building an abstract class with an abstract approach in it. All of these graphical objects share similar conditions (position, boundary box) and behavior (move, resize, and draw).

The visual artifacts are also dramatically different in several ways: creating a circle is very different from creating a rectangle. The entities in graphics cannot share these types of states or actions. In addition to this, all GraphicObjects must recognize how to build oneself; they just vary in the way they are derived. For an abstract superclass, that is a good scenario.
Genericity is one of the most effective means of getting flexibility in programming with programming languages. Genericity builds on many different types, which has a major effect on software articulation, static verifiability, modularity, and competence properties. With function pointers and void * pointers, generic algorithms can be implemented in C.
Generic Programming is easier, as it does not require explicit declaration or knowledge of the attributes of the objects being manipulated[ CITATION Ber101 \l 1033 ]. The official example is the templated max() function:
T max (T a, T b) {
return (b < a) ? a: b;
Under what conditions are T suitable for the function max? First, it should have a strict weak order with other objects of its class (the operator < must be set). Second, making a new T out of an old T (as is indirectly stated by the return statement) must be feasible.
The main concept of generic programming is to establish function or class family definitions. By specifying the physical shape, you get a function or class for this form immediately. Generic programming provides simplicity close to object-oriented programming. One major difference is that object-oriented programming polymorphism will occur at the running time; that generic programming polymorphism will occur at program execution in C++. That is why polymorphism is often called dynamic polymorphism at runtime, but polymorphism is often called static polymorphism at compilation. For example:
void * and function pointers work in C++.
Generic list example:
class Node{
void *data ; // points to real data
Node *next ; // points to next Node on the queue
Node() { data = NULL ; next = NULL ; }
~Node() { /* ??? */ }
} ;
A compiler can be split broadly into two stages, based on how they are compiled. The compiler's analysis process, known as the front-end of the compiler, reads the source program, splits it into core sections, and then searches for lexical, syntax, and grammatical mistakes. The analysis phase produces an inference mechanism of the source program and a symbol table that should be provided as input to the synthesis phase[ CITATION Kas19 \l 1033 ]. The compilation process is a multi-phase pattern. Also, every phase takes input from its preceding stage, has its source program description, and continues to feed its output to the compiler's next stage.


CITATION Rou20 \l 1033 : , (Rouse, 2020),
CITATION Ber101 \l 1033 : , (Bernardy, Jansson, Zalewski, & Schupp, 2010),
CITATION Kas19 \l 1033 : , (Kasyfi, Saputra, Apriansyah, & Soepriyono, 2019),

Download 24.96 Kb.

Share with your friends:

The database is protected by copyright © 2022
send message

    Main page