Some of the most important software engineering practices are as follows:
Object Oriented Programming is the most commonly used and known programming paradigm. It is widely used in developing software programs and other valuables as it helps the programmers or the developers to create a replica of the system being developed. This helps to instantiate a real-life model of the entire system with the main entities, their attributes and their underlying relationships. This mode of programming makes use of classes and objects to achieve the objectives. Classes are the blueprints consisting of all internal details including behaviours and characteristics. Objects on the other hand are the instances of these classes, which can be several in number. The main pillars of Object Oriented Programming are as follows:
Abstraction: Abstraction is the process of hiding the internal and irrelevant details in order to highlight only those that are essential to the user or the object. This can be related to a real life example where only the car is displayed to a customer instead of revealing all the internal parts individually. Data abstraction is used in object oriented programming in order to ignore the irrelevant attributes of the class and presenting only the necessary attributes for utilization in the objects. It is these behaviours and properties of an object that differentiate it from other similar objects and in turn helps in organizing or classifying them individually. Abstraction allows the initiation of many background attributes and methods which are not necessarily used in the exact way meant to. This is how the background details are concealed.
Example in python:
class AbstractClassExample (ABC):
def __init__(self, value):
self.value = value
super ().__init__()
@abstractmethod
def do_something (self):
pass
class DoAdd42 (AbstractClassExample):
def do_something (self):
return self.value + 42
class DoMul42 (AbstractClassExample):
def do_something(self):
return self.value * 42
x = DoAdd42(10)
y = DoMul42(10)
print (x.do_something())
print (y.do_something())
OUTPUT
52
420
Encapsulation: Encapsulation in object oriented programming is defined as the process of wrapping up of data into single module known as the class. When objects of this class are further created, these data members or member methods are included in each of these instances. Encapsulation further ignites the concept of data hiding, where only planned out data is made available for access to the outer classes through the use of private, public and protected techniques. This helps to confine all necessary data elements into one unit and accessible through it and also makes sure the data is kept secured from alien class access.
Example in python:
class test (object):
def __init__(self):
self.x = 123
self._y = 123
self.__z = 123
obj = test ()
print (obj.x)
print (obj._y) #should not be accessed by convention, but however no error. Print (obj.__z) #cannot be accessed as it is a hardcore private variable (Error)
OUTPUT
123
123
Traceback (most recent call last):
File “new.py”, line 10, in <module>
print(obj.__c)
AttributeError: ‘ test ‘ object has no attribute ‘__z’
Inheritance: This is one of the most important aspects of the object oriented programming paradigm. Inheritance refers to the ability of a program in which a class can be so designed for it to inherit certain or all properties from its parent class. This means that the data members or member methods from the parent class can be inherited by the child classes and used accordingly. Inheritance is very helpful in order to set up a meaningful relationship between related classes of the same type or genre. This technique allows the child classes to have pre-defined member variables and member methods that were previously initialized in the parent or the base class. This helps in curbing off code complexity and encourages re-usability of code. The members that have already been defined in the parent class needs not anymore be defined in the children. In addition, apart from the inherited properties, the child class can have other data members as well which will be its own.
Example in python:
class User:
name = “”
def __init__(self, name):
self.name = name
def printName(self):
print “Name = ” + self.name
class Programmer(User):
User.__init__ (self, name):
self.name = name
def doPython(self):
print (“Programming Python”)
brian = User(“brian”)
brian.printName()
diana = Programmer(“Diana”)
diana.printName()
diana.doPython()
OUTPUT:
Name = brian
Name = Diana
Programming Python
Polymorphism: Polymorphism is a term inspired from its usage in chemical engineering. Poly means ‘many and Morphus means ‘forms’. Polymorphism in object oriented programming defines the use of one or more methods in different forms. A particular method can be defined with various names but having a different set of parameters or arguments will able it to practice polymorphism fruitfully. This too enhances good programming practices as similar types of tasks can be performed using only methods of a similar name. Another form of polymorphism is exhibited with inheritance and is known as overriding. Here, the objects can call the methods of their respective classes even though other child or parent classes have the same named methods.
Example in Python:
class Bear(object):
def sound(self):
print “Groarrr”
class Dog(object):
def sound(self):
print “Woof woof!”
def makeSound(animalType):
animalType.sound()
bearObj = Bear()
dogObj = Dog()
makeSound(bearObj)
makeSound(dogObj)
OUTPUT:
Groarrr
Woof woof!
In software engineering, a commonly occurring software problem can be solved using a general repeatable solution. This solution or set of solutions is known as a software design pattern. Unlike a finished design documentation that can be directly converted into a developed programming prototype, it is merely a template that can be used to solve an individual problem that is recurring in nature within the system, or in other, it is a description documentation of a solution that can be used in many situations within the bigger problem.
Prototype design pattern is one very important creational design documentation process. In object oriented programming modules, prototypes are designed in order to guide the program by mentioning the kind of objects that are to be used with multiple instances for the entire problem.
The Staff class holds the base for the basic details of all the staffs that are to be added to the program. Each staff has attributes for their basic details and an additional list entity to hold the activities that are assigned to each of these staffs.
The Activity class holds the basic details for each activity like their names and date. Furthermore, it acts as the parent or the base class for the other two General activity and Investigator activity classes. It also has a display class that is inherited by the child classes and used by utilizing the polymorphism technology.
The GeneralAct class is one of the two child classes of the Activity class. It has all the basic attributes of its parent class and in addition to that it beholds a Time constraint data attribute. It overrides the Display() method definition from the parent Activity class.
The InvestigatorAct class is one of the other child class of the Activity class. It too has all the basic attributes of its parent class and in addition to that it beholds a the resource attribute that the investigator requires for the particular activity and a status that is primarily set to negative, to mark that the resources have not yet been received. It too overrides the Display() method definition from the parent Activity class, in order to produce a different display result as compared to the General Activity objects that has a different set of attribute.
The main() method is the driver or the controller of the program. It has the list to store all the newly added staffs. It displays the required menu to the user. A staff can use the system to add new staff entities and also add new activities to them. The Vice-principal is treated as the administrator of the system. He needs to sign into the system with a registered password (“asdqwe”). On validation of the password, the VP will be allowed to review all the staffs and their activity details added to the system. Furthermore, he or she can also access the resource status of the investigator staffs and update them to “Received” in case not already set as so. In this way, a track of the whole can be kept by the VP or the administrator.
The Activity class has been used as the parent class and the GeneralAct and InvestigatorAct classes as its child classes. They both are required to have the same set of basic attributes and methods like an activity name, initiation date and the display() member method. However, the activity stats of a general staff will be different from that of an investigator’s. Therefore, inheritance was used here. The general staff will have a general activity object under its tally with a time constraint as the attribute where as an investigator staff will store and access InvestigatorAct objects with a resource and receive status attribute.
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download