50% found this document useful (2 votes)
145 views

Advanced Programming

This document discusses advance programming concepts including object-oriented programming principles, design patterns, and UML class diagrams. It is divided into three parts. Part one discusses OOP concepts like classes, objects, encapsulation, inheritance and relationships between classes. Part two focuses on UML class diagrams, including how to create them and an example class diagram for a library management system. Part three requires developing code applying a design pattern and building an application based on UML class diagrams, including screenshots of a library management application.

Uploaded by

Milan Bhantana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
145 views

Advanced Programming

This document discusses advance programming concepts including object-oriented programming principles, design patterns, and UML class diagrams. It is divided into three parts. Part one discusses OOP concepts like classes, objects, encapsulation, inheritance and relationships between classes. Part two focuses on UML class diagrams, including how to create them and an example class diagram for a library management system. Part three requires developing code applying a design pattern and building an application based on UML class diagrams, including screenshots of a library management application.

Uploaded by

Milan Bhantana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 89

Advance programming

Contents
Part 1.....................................................................................................................................................5
Produce a presentation and there will be viva for following too:.........................................................5
 Examine the characteristics of the object-orientated paradigm as well as the various class
relationships..........................................................................................................................................5
 Determine a design pattern from each of the creational, structural and behavioral pattern
types......................................................................................................................................................5
 Analyze the relationship between the object-orientated paradigm and design patterns.............5
NOTE: IN part 1, Screenshot of presentation slides as well as video of your presentation is
required.................................................................................................................................................5
Presentation task:..............................................................................................................................5
Introduction.....................................................................................................................................16
Object-Oriented Programming:........................................................................................................16
Principles of object-oriented programming......................................................................................17
1. Encapsulation:.........................................................................................................................18
2. Abstraction..............................................................................................................................18
Advantages of Object-Oriented Programming...........................................................................19
Disadvantages of Object-Oriented Programming......................................................................19
How can Knowledge of OOP help in Career Growth?...............................................................19
How OOP is used in Software Development?...................................................................................20
Characteristic of Object Oriented Programming...............................................................................21
Class:...........................................................................................................................................22
Object:.........................................................................................................................................22
Encapsulation:.............................................................................................................................22
Abstraction:.................................................................................................................................24
Polymorphism:............................................................................................................................25
Inheritance:.................................................................................................................................26
Exception Handling.....................................................................................................................27
Oop Relationships Between Classes:................................................................................................27
Types of Class relationship in oop:....................................................................................................29
Collaboration...............................................................................................................................29
Composition.................................................................................................................................32
Inheritance.......................................................................................................................................37
Advance programming

Interfaces:....................................................................................................................................38
Abstract Class..............................................................................................................................39
Partial classes:.............................................................................................................................40
Delegates:.....................................................................................................................................41
Events:.........................................................................................................................................42
Generics:......................................................................................................................................43
Conclusion:.......................................................................................................................................44
Part 2...................................................................................................................................................47
 Design a series of UML class diagram:.......................................................................................47
 Design and build class diagrams using a UML tool....................................................................47
 Define class diagrams for specific design patterns using a UML tool........................................47
 Define/refine class diagrams derived from a given code scenario using a UML tool.................47
Introduction.....................................................................................................................................47
Design and build class diagrams using a UML tool............................................................................47
UML Class Diagram...........................................................................................................................47
Benefits of UML class diagrams..................................................................................................48
Basic components of a class diagram................................................................................................48
Member access modifiers............................................................................................................48
How to make a Uml class diagram....................................................................................................49
Why UML.........................................................................................................................................49
Uml class diagram for library management system:.........................................................................50
Conclusion:.......................................................................................................................................52
Part 3...................................................................................................................................................53
 Create a lab report to show that you have implement code applying design pattern:...............53
 Build an application derived from UML class diagrams............................................................53
 Develop code that implements a design pattern for a given purpose.........................................53
 Evaluate the use of design patterns for the given purpose specified in M3................................53
Table of content:..............................................................................................................................54
Report Introduction..........................................................................................................................59
Build an application derived from UML class diagrams.....................................................................59
Screenshot of designing pattern of application building derived from UML class diagrams:.............59
Login:...........................................................................................................................................60
Dashboard:..................................................................................................................................60
Advance programming

Users form:..................................................................................................................................60
Book category form:....................................................................................................................61
Books:..........................................................................................................................................62
Issue:............................................................................................................................................62
Returns:.......................................................................................................................................65
Search:.........................................................................................................................................65
Report Conclusion............................................................................................................................66
Part 4...................................................................................................................................................69
 Write an article about your investigation on scenarios with respect to design pattern.............69
 Discuss a range of design patterns with relevant examples of creational, structural and
behavioral pattern types.....................................................................................................................69
 Reconcile the most appropriate design pattern from a range with a series of given scenarios..69
 Critically evaluate a range of design patterns against the range of given scenarios with
justification of your choices................................................................................................................69
Article Introduction..........................................................................................................................69
Discuss a range of design patterns with relevant examples of creational, structural and behavioral
pattern types....................................................................................................................................69
Design Patterns................................................................................................................................69
Uses of Design Patterns...............................................................................................................70
Types of design pattern:...................................................................................................................70
1. Creational design patterns:.................................................................................................70
Range of creational pattern:.......................................................................................................71
Example with code:.....................................................................................................................71
2. Structural design patterns:..................................................................................................76
Range of Structural Design Pattern:...........................................................................................76
Example Code:............................................................................................................................76
3. Behavioral design patterns:.................................................................................................78
Range of Behavioral Design Pattern:..........................................................................................78
Code example:.............................................................................................................................79
Article Conclusion.............................................................................................................................81
References:.......................................................................................................................................83
Advance programming

Part 1

Produce a presentation and there will be viva for following too:

 Examine the characteristics of the object-orientated paradigm as well as the various


class relationships.

 Determine a design pattern from each of the creational, structural and behavioral
pattern types.

 Analyze the relationship between the object-orientated paradigm and design


patterns.

NOTE: IN part 1, Screenshot of presentation slides as well as video of your presentation is


required.

Presentation task:
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming
Advance programming

Introduction

According to the current scenario, Cosmos International College is newly setup yet reputed
college in Pokhara with an aim to provide quality management education to its students. In past
years, the students record were handled using the excel file method. The admin had hard time for
record management after the increase in significant amount of students and the newly established
library system. As being a full stack software developer, the college has provided a project for
me to create a software for the “Library Management” which will be able to handle all of these
student, staff and book records with some other specific user requirements. In this part, I will
simply demonstrate the ideas of object oriented programming, design patterns, analyze and
present their relationships and finally represent their application in our software.

Object-Oriented Programming: Object-Oriented Programming (or OOP) is a paradigm of


programming in which programs are written and structured around objects rather than functions
or logic. Here, objects are defined as data fields which have unique attributes and behavior. They
contain data in the form of attributes and procedures in the form of methods. Object procedures
can access and modify the data present in an object.
Advance programming

There are many OOP languages, with the most popular ones being class-based, where objects
will be an instance of a class. A class is a container for data and procedures, also known as data
members and member functions. Let us consider an example of an object as a car. A car has
attributes like color, brand name, fuel capacity, etc. and it has methods to represent the behavior
of a car like a start, accelerate, break, etc. A class is a blueprint of attributes and methods and
does not occupy space, until and unless an object for that class is made. (EDUCBA, 2020)

Example:

class car

char name[20];  // name and colour are attributes

char colour[20];

public void start(){}           //start is a method

};

void main()

car c1;         //c1 is an object

Object-oriented programming targets to implement in programming, real-world entities like


inheritance, polymorphism, encapsulation, etc. which we will see in detail. The main objective of
OOP is to collectively bind data and the functions that operate on them, such that this data is
accessible only by that function.inc(EDUCBA, 2020)iples of OOP

Principles of object-oriented programming 

1. Encapsulation:
Binding of data and methods into a single unit is called encapsulation. Encapsulation is
accomplished when each object inside the class keeps its state private. The data inside this unit is
Advance programming

not accessible by outside objects and only those functions inside this unit are able to access it.
Thus, the object manages its state with the help of its methods, and to communicate with this
object, we will require the help of the public methods of this class.

2. Abstraction
Abstraction is an extension of encapsulation. It means providing only the necessary information
to the outside world while hiding the internal details of implementation. It reveals only the
appropriate operations for other objects. The advantage of this is that we can change the
implementation without affecting the class, as the method interface remains the same.

Let us take the example of a calculator, which takes the input from us, and on the press of a
button, gives us the desired output, while sparing us the internal details of how it has arrived at
that answer. (EDUCBA, 2020)

3. Inheritance

Often, objects are similar in functionality, sharing part of the logic but differing in the rest. So
how do we reuse the common logic and separate the different logic? This can be achieved by
inheritance. In inheritance, we create a new class called as child class which is derived from the
existing class called the parent class, thus forming a hier0archy of classes. The child class reuses
the data fields and methods that it requires from the parent class, and implements its unique
functionality on its own.

For example, a vehicle can be a parent class, from which we can derive child classes like Bike
and Car. They share the common properties of being able to run on fuel and carry passengers but
differ in the number of passengers they can carry and more such properties.

4. Polymorphism

Polymorphism is the ability to take more than one form. Suppose we have a parent class and a
few of its child classes. Now we want to use attributes from both the parent and the child classes,
so how will it be achieved? This can be done using Polymorphism. In Polymorphism, abstract
entities are executed in multiple ways. It gives a way to consume a class exactly like the parent
class, such that there is no confusion with mixing the type of classes, and each child class
Advance programming

continues to keep its methods the way it was. This can be done by reusing a parent interface so
that the child class can implement these methods in their own version. (EDUCBA, 2020)

Advantages of Object-Oriented Programming

 A real-world idea can be demonstrated, as everything in OOP is treated as an object.


 As we use the concept of encapsulation, programs are easier to test and maintain.
 Faster development of code is done, as we develop classes parallel instead of
sequentially.
 OOP provides greater security due to data abstraction. The outside world cannot access
the hidden data.
 Reusability can be achieved by using classes that have been already written.

 
Disadvantages of Object-Oriented Programming

 Designing a program with OOP concept can be tricky.


 A programmer needs to plan beforehand for developing a program in OOP.
 The size of programs developed with OOP is bigger than those developed with a
procedural approach.
 Since OOP programs are larger in size, the execution time for these programs is also
more.

 
How can Knowledge of OOP help in Career Growth?

Many of the major trending languages these days like Java and Ruby, use Object-oriented
programming concepts. OOP languages help in writing software for applications such as mobile,
web and gaming applications. There are high earnings in these fields, like the best job
opportunities for programmers to lie in these fields. It is easy to move into various technologies
and languages with the basics of OOP, and thus this widens our career prospects. One drawback
in this happens to be expertise. Usually, companies look for practical experience in OOP
Advance programming

languages and concepts, so it is recommended to practice as we go along the learning process.


(EDUCBA, 2020)

How OOP is used in Software Development?

In any complexity of software development, OOP is the best to solve the issue. These are the
areas where OOP is used (Buyya et al, 2009):

 Image processing

 Pattern recognition

 Computer assisted concurrent engineering

 Computer aided design and manufacturing

 Computer aided teaching

 Intelligent systems

 Database management systems

 Web based applications

 Distributed computing and applications

 Component based applications

 Business process reengineering

 Enterprise resource planning

 Data security and management

 Mobile computing
Advance programming

 Data warehousing and data mining

 Parallel computing

OOP just helps us to load the real world problem into software which can be modified in
different ways depending on the needs. Once a code generated for any software can be used
again and again to serve other applications with same functions. This helps in saving lots of time
for the programmers and also helps in making the program flexible so that it can be easily
modified when there is need.

I think OOP is not a successful approach to a beginner in programming because programming is


not easy until the programmer does not know what objects or classes are. OOP have many
advantages but they will work for the programmers having good knowledge in the concepts of
programming. Despite all the advantages, a beginner cannot distinguish between the classes,
objects or any other things which makes it difficult to understand. So I think a beginner should
start with low level programs to learn the basic concepts and then move to OOP.

Characteristic of Object Oriented Programming

Object Oriented programming is a programming style that is associated with the concept of
Class, Objects and various other concepts revolving around these two, like Inheritance,
Polymorphism, Abstraction, Encapsulation etc.
Advance programming

Every Human being(Male or Female) has two legs, two hands, two eyes, one nose, one heart etc.
There are body parts that are common for Male and Female, but then there are some specific
body parts, present in a Male which are not present in a Female, and some body parts present in
Female but not in Males. All Human Beings walk, eat, see, talk, hear etc. Now again, both Male
and Female, performs some common functions, but there are some specifics to both, which is not
valid for the other. For example : A Female can give birth, while a Male cannot, so this is only
for the Female. Human Anatomy is interesting, isn't it? But let's see how all this is related to C++
and OOPS. Here we will try to explain all the OOPS concepts through this example and later we
will have the technical definitons for all this.

Class: It is similar to structures in C language. Class can also be defined as user defined data
type but it also contains functions in it. So, class is basically a blueprint for object. It declare &
defines what data variables the object will have and what operations can be performed on the
class's object. Here we can take Human Being as a class. A class is a blueprint for any functional
entity which defines its properties and its functions. Like Human Being, having body parts, and
performing various actions. (Vegibit.com, 2020)

A Class is a user-defined data-type which has data members and member functions.
Advance programming

 Data members are the data variables and member functions are the functions used to
manipulate these variables and together these data members and member functions define
the properties and behaviour of the objects in a Class.
 In the above example of class Car, the data member will be speed limit, mileage etc and
member functions can apply brakes, increase speed etc.
We can say that a Class in C++ is a blue-print representing a group of objects which shares
some common properties and behaviours.

Object:  Objects are the basic unit of OOP. They are instances of class, which have data
members and uses various member functions to perform tasks. Object take up space in memory
and have an associated address like a record in pascal or structure or union in C. When a
program is executed the objects interact by sending messages to one another. Each object
contains data and code to manipulate the data. Objects can interact without having to know
details of each other’s data or code, it is sufficient to know the type of message accepted and
type of response returned by the objects.

Encapsulation: This concept is a little tricky to explain with our example. Our Legs are binded
to help us walk. Our hands, help us hold things. This binding of the properties to functions is
called Encapsulation. It can also be said data binding. Encapsulation is all about binding the data
variables and functions together in class.

Consider a real-life example of encapsulation, in a company, there are different sections like the
accounts section, finance section, sales section etc. The finance section handles all the financial
transactions and keeps records of all the data related to finance. Similarly, the sales section
handles all the sales-related activities and keeps records of all the sales. Now there may arise a
situation when for some reason an official from the finance section needs all the data about sales
in a particular month. In this case, he is not allowed to directly access the data of the sales
section. He will first have to contact some other officer in the sales section and then request him
to give the particular data. This is what encapsulation is. Here the data of the sales section and
the employees that can manipulate them are wrapped under a single name “sales section”.
(GeeksforGeeks, 2019)
Advance programming

Abstraction: Abstraction refers to showing only the essential features of the application and
hiding the details. In C#, classes can provide methods to the outside world to access & use the
data variables, keeping the variables hidden from direct access, or classes can even declare
everything accessible to everyone, or maybe just to the classes inheriting it. This can be done
using access specifiers. Abstraction means, showcasing only the required things to the outside
world while hiding the details. Continuing our example, Human Being's can talk, walk, hear, eat,
Advance programming

but the details are hidden from the outside world. We can take our skin as the Abstraction factor
in our case, hiding the inside mechanism.

 Abstraction using Classes: We can implement Abstraction in C++ using classes. The
class helps us to group data members and member functions using available access
specifiers. A Class can decide which data member will be visible to the outside world and
which is not.
 Abstraction in Header files: One more type of abstraction in C++ can be header files. For
example, consider the pow() method present in math.h header file. Whenever we need to
calculate the power of a number, we simply call the function pow() present in the math.h
header file and pass the numbers as arguments without knowing the underlying algorithm
according to which the function is actually calculating the power of numbers.
Polymorphism: It is a feature, which lets us create functions with same name but different
arguments, which will perform different actions. That means, functions with same name, but
functioning in different ways. Or, it also allows us to redefine a function to provide it with a
completely new definition. You will learn how to do this in details soon in coming lessons.
Polymorphism is a concept, which allows us to redefine the way something works, by either
changing how it is done or by changing the parts using which it is done. Both the ways have
different terms for them. (Vegibit.com, 2020)

 Overloading: If we walk using our hands, and not legs, here we will change the parts
used to perform something. Hence this is called Overloading.
 Overriding: And if there is a defined way of walking, but I wish to walk differently, but
using my legs, like everyone else. Then I can walk like I want, this will be called
as Overriding.

Example: Suppose we have to write a function to add some integers, some times there are 2
integers, some times there are 3 integers. We can write the Addition Method with the same name
having different parameters, the concerned method will be called according to parameters.
Advance programming

Inheritance: Inheritance is a way to reuse once written code again and again. The class which is
inherited is called the Base class & the class which inherits is called the Derived class. They are
also called parent and child class. So when, a derived class inherits a base class, the derived class
can use all the functions which are defined in base class, hence making code reusable.
Considering HumanBeing a class, which has properties like hands, legs, eyes etc, and functions
like walk, talk, eat, see etc. Male and Female are also classes, but most of the properties and
functions are included in HumanBeing, hence they can inherit everything from
class HumanBeing using the concept of Inheritance.
Advance programming

Exception Handling
Exception handling is a feature of OOP, to handle unresolved exceptions or errors produced at
runtime. (Vegibit.com, 2020)

Oop Relationships Between Classes:


Advance programming

We saw that a Collaboration relationship is commonly referred to as a “Uses A” relationship.


Classes with a Collaboration relationship use an instance of the needed Class and call its
properties or use its methods. The OrderRepository Class uses an instance of the Order Class
when retrieving or saving an Order as seen in this code here.

1 public Order Retrieve(int orderId)

2{

3     Order order = new Order(orderId);

5     return order;

6}
In addition, the AddressRepository Class uses an instance of the Address Class when retrieving
or saving an Address. The CustomerRepository Class uses an instance of the Customer Class
when retrieving or saving a Customer. So you can see how this type of relationship works.

We also had a look at Composition relationships which use the “Has A” convention.


Composition relationships can be set up one of two ways. The first is by defining a property in
one Class that references a different Class. In the Customer Class we defined a List of Addresses.
This is really a List of Address objects. The AddressList property defines the Composition
relationship between the Customer Class and the Address Class.

1 public Customer(int customerId)

2{

3     this.CustomerId = customerId;

4     AddressList = new List<Address>();

5}


Advance programming

7 public List<Address> AddressList { get; set; }


The second way to establish a Composition relationship is by using ids. An example of this is
when we added a customer id and an address it to the Order class. Since these classes are just
using ids instead of object references it is easier to retrieve and save Order data. With this
approach you might need to add additional classes to get full functionality such as being able to
display an Order. Finally, we had just a quick look at Inheritance in object oriented programming
which sets up the “Is A” convention.

Types of Class relationship in oop: There are many types of relationships in object-oriented
programming. The first one we will look at is the collaboration relationship. In a collaboration
relationship, you often refer to it as a “Uses A” relationship. This is because you can think of one
class using another class. The next type of relationship we’ll look at is a composition
relationship. A composition relationship can be referred to using a “Has A” relationship type.
The idea of composition is that an object can be composed of other objects. An Order has a
Customer. An Order also has a OrderItem. The last relationship type we will look at is
Inheritance, or a “Is A” relationship. A CommercialCustomer is a Customer or a
ConsumerCustomer is a Customer. (Vegibit.com, 2020)

Collaboration
Here we have a diagram of a collaboration type relationship between classes. The
OrderRepository “uses a” Order object to populate on a Retrieve, and to serialize on a save. The
same goes for the CustomerRepository “using a” Customer object and a ProductRepository
“using a” Product object. (Vegibit.com, 2020)
Advance programming

In this code we can see how the CustomerRepository class uses a Customer class. Inside of the
Retrieve() method, we see how a new Customer object is created. That object is then populated
with data. In our case it is simply hard-coded, but you could imagine this data coming from a
database.

The CustomerRepository uses a Customer object once again in the Save() method. In order for
that method to do its job, it needs to accept a Customer object as a parameter. Inside that method,
the data from the Customer object would be used to persist to the database. The repository
classes use an entity class to populate the entity, or serialize the entity depending on if it is being
used in the Retrieve() or Save() methods. This pattern holds true for the other repository classes
we have been working with as well.

1 using System;
Advance programming

2 using System.Collections.Generic;

3 using System.Linq;

4 using System.Text;

5 using System.Threading.Tasks;

6  

7 namespace CRMBIZ

8 {

9     public class CustomerRepository

10     {

11         public Customer Retrieve(int customerId)

12         {

13             Customer customer = new Customer(customerId);

14  

15             if (customerId == 1)

16             {

17                 customer.EmailAddress = "[email protected]";

18                 customer.FirstName = "Susan";

19                 customer.LastName = "Smith";

20             }

21             return customer;

22         }

23  
Advance programming

24         public List<Customer> Retrieve()

25         {

26             return new List<Customer>();

27         }

28  

29         public bool Save(Customer customer)

30         {

31             return true;

32         }

33     }

34 }
You can spot a collaboration type relationship any time you see a class use an instance of another
class to perform an operation in the application.

Composition
Composition is another key relationship type in object-oriented programming. A composition
relationship exists when an object from one class, is made up of or composed of one or more
objects from another class. It is also known as a “Has A” type relationship. In our CRM
application this type of relationship exists between the Customer class and the Address class. A
Customer “Has A” Address. (Vegibit.com, 2020)
Advance programming

In the diagram above we show some composition relationships. The Customer class “Has A”
Address. The Order object is also composed of other objects. Every Order has a Customer, has
an Address, and has an OrderItem. Additionally, each OrderItem “Has A” Product. So we can
kind of see how a given object can be composed of other objects to make the application work.
The Composition relationship can be accomplished using references in our code, which leverage
class properties. Let’s have a look at the Customer class to see how this works. First we’ll look
at the composition relationship between the Customer class and Address class. In the below
code, we have highlighted a specific property. The Customer object is composed of one or more
Address objects. Why one or more? Because there could be a home address or a work address.
So we use a property of type List to allow for one or more Address objects to help compose a
Customer object. A property declaration in the Customer class establishes the composition
relationship between the Customer class and the Address class. Also note that since this property
is a List, it must be initialized in the constructor like we also see below. If it is not, it would
cause a null value exception.

1 using System;
Advance programming

2 using System.Collections.Generic;

3 using System.Linq;

4 using System.Text;

5 using System.Threading.Tasks;

6  

7 namespace CRMBIZ

8 {

9     public class Customer

10     {

11         public Customer()

12             : this(0)

13         {

14  

15         }

16  

17         public Customer(int customerId)

18         {

19             this.CustomerId = customerId;

20             AddressList = new List<Address>();

21         }

22  

23         public List<Address> AddressList { get; set; }


Advance programming

24  

25         public int CustomerType { get; set; }

26         public static int InstanceCount { get; set; }

27  

28         private string _lastName;

29         public string LastName

30         {

31             get

32             {

33                 return _lastName;

34             }

35             set

36             {

37                 _lastName = value;

38             }

39         }

40  

41         public string FirstName { get; set; }

42  

43         public string EmailAddress { get; set; }

44  

45         public int CustomerId { get; private set; }


Advance programming

46  

47         public string FullName

48         {

49             get

50             {

51                 string fullName = LastName;

52                 if (!string.IsNullOrWhiteSpace(FirstName))

53                 {

54                     if (!string.IsNullOrWhiteSpace(fullName))

55                     {

56                         fullName += ", ";

57                     }

58                     fullName += FirstName;

59                 }

60                 return fullName;

61             }

62         }

63  

64         public bool Validate()

65         {

66             var isValid = true;

67  
Advance programming

68             if (string.IsNullOrWhiteSpace(LastName)) isValid = false;

69             if (string.IsNullOrWhiteSpace(EmailAddress)) isValid = false;

70  

71             return isValid;

72         }

73     }

74 }

Inheritance

In object oriented programming we also have the Inheritance style of relationship. In Inheritance
you have an “Is A” type of relationship. Inheritance allow you to build a class that inherits the
members of its parent or base class. This allows you to define a more specific type of class. So
consider the Customer class. We might have Business customers and Education customers. They
are both customers, but different kinds of customers. This allows for code reuse since child
classes that inherit members from their parent class, are using the properties and methods already
defined in the parent class. (Vegibit.com, 2020)
Advance programming

When using inheritance in C#, you can only directly inherit from one class. You can however set
up inheritance chains if you like. In other words you could have a Customer class, and an
Education class that inherits from Customer. Then, you could set up a College class, that inherits
from the Education class.

Interfaces: In general, an interface is a device or a system that unrelated entities use to interact.
According to this definition, a remote control is an interface between you and a television set, the
English language is an interface between two people, and the protocol of behavior enforced in
the military is the interface between people of different ranks. Within the Java programming
language, an interface is a type, just as a class is a type. Like a class, an interface defines
methods. Unlike a class, an interface never implements methods; instead, classes that implement
the interface implement the methods defined by the interface. A class can implement multiple
interfaces. (Vegibit.com, 2020)

The bicycle class and its class hierarchy define what a bicycle can and cannot do in terms of its
"bicycleness." But bicycles interact with the world on other terms. For example, a bicycle in a
store could be managed by an inventory program. An inventory program doesn’t care what class
of items it manages, as long as each item provides certain information, such as price and tracking
number. Instead of forcing class relationships on otherwise unrelated items, the inventory
program sets up a protocol of communication. This protocol comes in the form of a set of
method definitions contained within an interface. The inventory interface would define, but not
implement, methods that set and get the retail price, assign a tracking number, and so on.

To work in the inventory program, the bicycle class must agree to this protocol by implementing
the interface. When a class implements an interface, the class agrees to implement all the
methods defined in the interface. Thus, the bicycle class would provide the implementations for
the methods that set and get retail price, assign a tracking number, and so on. You use an
interface to define a protocol of behavior that can be implemented by any class anywhere in the
class hierarchy. Interfaces are useful for the following: (C-sharpcorner.com, 2019)
Advance programming

 Capturing similarities among unrelated classes without artificially forcing a class


relationship
 Declaring methods that one or more classes are expected to implement
 Revealing an object's programming interface without revealing its class
 Modelling multiple inheritance, a feature that some object-oriented languages
support that allows a class to have more than one superclass

Abstract Class

An abstract class is a class that is declared abstract — it may or may not include abstract
methods. Abstract classes cannot be instantiated, but they can be subclassed. An abstract class
may have static fields and static methods. When an abstract class is subclassed, the subclass
usually provides implementations for all of the abstract methods in its parent class. However, if it
does not, then the subclass must also be declared abstract. (Vegibit.com, 2020)

An abstract method is a method that is declared without an implementation (without braces and
followed by a semicolon), like this:

abstract void sum(int a, int b);

Consider using abstract classes if any of these statements apply to your situation:

1. You want to share code among several closely related classes.


2. You expect that classes that extend your abstract class have many common methods or
fields or require access modifiers other than public (such as protected and private).
3. You want to declare non-static or non-final fields. This enables you to define methods
that can access and modify the state of the object to which they belong.

Partial classes: A partial class is a special feature of C#. It provides a special ability to
implement the functionality of a single class into multiple files and all these files are combined
into a single class file when the application is compiled. A partial class is created by using
Advance programming

a partial keyword. This keyword is also useful to split the functionality of methods, interfaces, or
structure into multiple files. (Vegibit.com, 2020)
Important points:
 When you want to chop the functionality of the class, method, interface, or structure into
multiple files, then you should use partial keyword and all the files are mandatory to
available at compile time for creating final file.
 The partial modifier can only present instantly before the keywords like struct, class, and
interface.
 Every part of the partial class definition should be in the same assembly and namespace,
but you can use different source file name.
 Every part of the partial class definition should have the same accessibility like private,
protected, etc.
 If any part of the partial class is declared as an abstract, sealed, or base, then the whole
class is declared of the same type.
 The user is also allowed to use nested partial types.
 Dissimilar part may have dissimilar base types, but the final type must inherit all the base
types.
Example: Here, we are taking a class named as Geeks and split the definition of Geeks class into
two different files named as Geeks1.cs, and Geeks2.cs as shown below:
Advance programming

In Geeks1.cs, and Geeks2.cs, a partial class is created using the partial keyword and each file
contains different functionality of Geeks class

Delegates: A delegate is a type that represents references to methods with a particular parameter
list and return type. When you instantiate a delegate, you can associate its instance with any
method with a compatible signature and return type. You can invoke (or call) the method through
the delegate instance.

Delegates are used to pass methods as arguments to other methods. Event handlers are nothing
more than methods that are invoked through delegates. You create a custom method, and a class
such as a windows control can call your method when a certain event occurs. The following
example shows a delegate declaration. Delegation is an important design pattern itself. It's used a
lot in Objective C and NEXTSTEP programming as an alternative to mandatory inheritance from
a complex framework and multiple inheritance.

If B is a subclass of A then sending B a message for something in A's interface means that B can
re-use the implemtation found in A. Delegation uses composition to put re-use the
implementation from A. B's interface can be extended to have some of the same functionality of
A. But when a B object is sent a message corresponding to a method in A's type, it forwards the
message to an A object. The aggregation design we saw earlier for implementing a Set in terms
of a List is an example of the use of delegation. (Vegibit.com, 2020)

Properties:

Delegates have the following properties:

 Delegates are similar to C++ function pointers, but delegates are fully object-oriented,
and unlike C++ pointers to member functions, delegates encapsulate both an object
instance and a method.

 Delegates allow methods to be passed as parameters.

 Delegates can be used to define callback methods.


Advance programming

 Delegates can be chained together; for example, multiple methods can be called on a
single event.

 Methods do not have to match the delegate type exactly. For more information, see Using
Variance in Delegates.

 C# version 2.0 introduced the concept of anonymous methods, which allow code blocks
to be passed as parameters in place of a separately defined method. C# 3.0 introduced
lambda expressions as a more concise way of writing inline code blocks. Both anonymous
methods and lambda expressions (in certain contexts) are compiled to delegate types.
Together, these features are now known as anonymous functions. For more information
about lambda expressions, see Lambda expressions.

Events: Events enable a class or object to notify other classes or objects when something of
interest occurs. The class that sends (or raises) the event is called the publisher and the classes
that receive (or handle) the event are called subscribers.

In a typical C# Windows Forms or Web application, you subscribe to events raised by controls
such as buttons and list boxes. You can use the Visual C# integrated development environment
(IDE) to browse the events that a control publishes and select the ones that you want to handle.
The IDE provides an easy way to automatically add an empty event handler method and the code
to subscribe to the event. For more information, see How to: Subscribe to and Unsubscribe from
Events. (Vegibit.com, 2020)

Events Overview

Events have the following properties:

 The publisher determines when an event is raised; the subscribers determine what
action is taken in response to the event.

 An event can have multiple subscribers. A subscriber can handle multiple events from
multiple publishers.
Advance programming

 Events that have no subscribers are never raised.

 Events are typically used to signal user actions such as button clicks or menu selections
in graphical user interfaces.

 When an event has multiple subscribers, the event handlers are invoked synchronously
when an event is raised. To invoke events asynchronously, see Calling Synchronous
Methods Asynchronously.

 In the .NET Framework class library, events are based on the EventHandler delegate


and the EventArgs base class.

Generics: it is a class which allows the user to define classes and methods with the placeholder.
Generics were added to version 2.0 of the C# language. The basic idea behind using Generic is to
allow type (Integer, String, … etc and user-defined types) to be a parameter to methods, classes,
and interfaces. A primary limitation of collections is the absence of effective type checking. This
means that you can put any object in a collection because all classes in the C# programming
language extend from the object base class. This compromises type safety and contradicts the
basic definition of C# as a type-safe language. In addition, using collections involves a
significant performance overhead in the form of implicit and explicit type casting that is required
to add or retrieve objects from a collection.

To address the type safety issue, the .NET framework provides generics to create classes,
structures, interfaces, and methods that have placeholders for the types they use. Generics are
commonly used to create type-safe collections for both reference and value types.
The .NET framework provides an extensive set of interfaces and classes in the
System.Collections.Generic namespace for implementing generic collections.

Generics in C# is its most powerful feature. It allows you to define the type-safe data structures.
This out-turn in a remarkable performance boost and high-grade code, because it helps to reuse
data processing algorithms without replicating type-specific code. Generics are similar to
Advance programming

templates in C++ but are different in implementation and capabilities. Generics introduces the
concept of type parameters, because of which it is possible to create methods and classes that
defers the framing of data type until the class or method is declared and is instantiated by client
code. Generic types perform better than normal system types because they reduce the need for
boxing, unboxing, and type casting the variables or objects. (Vegibit.com, 2020)

Features of Generics

Generics is a technique that enriches your programs in the following ways −

 It helps you to maximize code reuse, type safety, and performance.

 You can create generic collection classes. The .NET Framework class library contains
several new generic collection classes in the System.Collections.Generic namespace.
You may use these generic collection classes instead of the collection classes in
the System.Collections namespace.

 You can create your own generic interfaces, classes, methods, events, and delegates.

 You may create generic classes constrained to enable access to methods on particular
data types.

 You may get information on the types used in a generic data type at run-time by means
of reflection.

Conclusion: in this task firstly, I have done presentation about the relationship between oop and
design pattern. After that I have mention the definition of oop as well as their characteristic,
properties and relationship between oop and different classes. I have also attaches the screenshot
of coding in characteristic example.
Advance programming
Advance programming

Part 2

 Design a series of UML class diagram:

 Design and build class diagrams using a UML tool.

 Define class diagrams for specific design patterns using a UML tool.

 Define/refine class diagrams derived from a given code scenario using a UML tool.

Introduction

In the previous task, I have described about the different programming paradigms which are
quite useful for project development. Now, in this task I will describe about the class diagrams,
UML tools and design class diagrams from those UML tools for the project. This will also
include about the purpose of class diagram for the project planning, class relationships and
operations with various examples. The use of class diagrams are quite important if we seek the
long term development of project. Such processes will guide the developers to use the design in
specific terms.

Design and build class diagrams using a UML tool.

UML Class Diagram

The Unified Modeling Language (UML) can help you model systems in various ways. One of
the more popular types in UML is the class diagram. Popular among software engineers to
document software architecture, class diagrams are a type of structure diagram because they
describe what must be present in the system being modeled. No matter your level of familiarity
with UML or class diagrams, our UML software is designed to be simple and easy to use.

UML was set up as a standardized model to describe an object-oriented programming approach.


Since classes are the building block of objects, class diagrams are the building blocks of UML.
Advance programming

The various components in a class diagram can represent the classes that will actually be
programmed, the main objects, or the interactions between classes and objects. 

The class shape itself consists of a rectangle with three rows. The top row contains the name of
the class, the middle row contains the attributes of the class, and the bottom section expresses the
methods or operations that the class may use. Classes and subclasses are grouped together to
show the static relationship between each object. (Fakhroutdinov, 2020)

Benefits of UML class diagrams

Class diagrams offer a number of benefits for any organization. Use UML class diagrams to:

 Illustrate data models for information systems, no matter how simple or complex.
 Better understand the general overview of the schematics of an application.
 Visually express any specific needs of a system and disseminate that information
throughout the business.
 Create detailed charts that highlight any specific code needed to be programmed and
implemented to the described structure.
 Provide an implementation-independent description of types used in a system that are
later passed between its components.

Basic components of a class diagram

The standard class diagram is composed of three sections: (Fakhroutdinov, 2020)

 Upper section: Contains the name of the class. This section is always required, whether
you are talking about the classifier or an object.
 Middle section: Contains the attributes of the class. Use this section to describe the
qualities of the class. This is only required when describing a specific instance of a class.
 Bottom section: Includes class operations (methods). Displayed in list format, each
operation takes up its own line. The operations describe how a class interacts with data.
Advance programming

Member access modifiers

All classes have different access levels depending on the access modifier (visibility). Here are
the access levels with their corresponding symbols:

 Public (+)
 Private (-)
 Protected (#)
 Package (~)
 Derived (/)
 Static (underlined)

How to make a Uml class diagram

In Lucidchart, creating a class diagram from scratch is surprisingly simple. Just follow these
steps: (Fakhroutdinov, 2020)

1. Open a blank document or start with a template.

2. Enable the UML shape library. On the left side of the Lucidchart editor, click "Shapes."
Once you're in the Shape Library Manager, check "UML" and click "Save."

3. From the libraries you just added, select the shape you want and drag it from the toolbox
to the canvas.

4. Model the process flow by drawing lines between shapes while adding text.

Why UML

As the strategic value of software increases for many companies, the industry looks for
techniques to automate the production of software and to improve quality and reduce cost and
time-to-market. These techniques include component technology, visual programming, patterns
and frameworks. Businesses also seek techniques to manage the complexity of systems as they
increase in scope and scale. In particular, they recognize the need to solve recurring
Advance programming

architectural problems, such as physical distribution, concurrency, replication, security, load


balancing and fault tolerance. Additionally, the development for the World Wide Web, while
making some things simpler, has exacerbated these architectural problems. The Unified
Modeling Language (UML) was designed to respond to these needs. The primary goals in the
design of the UML summarize by Page-Jones in Fundamental Object-Oriented Design in UML
as follows: (Visual-paradigm.com, 2019)
1. Provide users with a ready-to-use, expressive visual modeling language so they can
develop and exchange meaningful models.
2. Provide extensibility and specialization mechanisms to extend the core concepts.
3. Be independent of particular programming languages and development processes.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of the OO tools market.
6. Support higher-level development concepts such as collaborations, frameworks,
patterns and components.
7. Integrate best practices.

Uml class diagram for library management system:


Advance programming

UML Class diagram for library management system contains classes

 such as
 Book class
 librarian class
 catalog
 Member record class
 alert
Advance programming

Each class contains various attributes and methods(Functions) which call other class attributes to
share data.

 Book Class contains attributes such as author,book name,price status,rack no,edition.


and functions such as display book details,update status.
 librarian class contains attributes such as name,password and functions such as search
book,issue book,calculate fine,calculate bill.
 transaction class contains attributes such as transaction id,member id bill id date of issue
etc. and functions such as create transaction delete transaction.
 Member record class contains attributes such as member id,type,date of issue,no of
books,etc. and functions such as increase book issue, decrease book issue,pay bill.
 Bill class contains attributes such as bill no,date,member,amount and functions such as
create bill,update bill.

Conclusion: in this task I have define the definition about UML. For completion of task we need
to done the uml diagram of library management system which is based on scenario of Cosmos
College. So I have attach the screenshot of uml of library management system which is above.
Advance programming

Part 3

 Create a lab report to show that you have implement code applying design pattern:

 Build an application derived from UML class diagrams.

 Develop code that implements a design pattern for a given purpose.

 Evaluate the use of design patterns for the given purpose specified in M3.

Submitted To:
Submitted By:
Binod shah
Prabin Bhusal
Submitted Date:

27nd December, 2019


Advance programming

Table of content:

Report Introduction

In the previous tasks, I had described about the UML class diagrams and presented the UML diagrams for
the library management system of Cosmos College. In this task, I will implement those class diagrams
and develop a fully functional software. Hence, I will present the screenshots of the UI designs and finally
explain about the design patterns used to develop the programs and explain about the reasons for applying
those patterns.

Build an application derived from UML class diagrams.

Screenshot of designing pattern of application building derived from UML class diagrams:

Login:
Advance programming

Dashboard:

Users form:
Advance programming

Book category form:

Books:
Advance programming

Members:

Issue:
Advance programming
Advance programming
Advance programming

Returns:
Advance programming

Search:

Log out:
Advance programming

Report Conclusion

While developing a web application, understanding MVC design can be an important technique since it
not only allows creating reusable and separate models which can be easily upgraded but also effectively
reduces the overall time for developing an efficient application. The MVC theory is a basic concept in
computer programming and helps in giving several web development services and projects. In this task, I
have provided implemented the Library management system for Cosmos College, and provide the
screenshots of UI and source codes to describe their implementation processes.
Advance programming
Advance programming

Part 4

 Write an article about your investigation on scenarios with respect to design


pattern.

 Discuss a range of design patterns with relevant examples of creational, structural


and behavioral pattern types.

 Reconcile the most appropriate design pattern from a range with a series of given
scenarios.

 Critically evaluate a range of design patterns against the range of given scenarios
with justification of your choices.

Investigation of design pattern.


Prabin bhusal
27nd December, 2019

Article Introduction

This is the final part of our assignment that will require the description for the investigation on scenario
with respect to the design pattern. In the above tasks, I have described about the designs,
implementations, patterns and many more about the Library management system. Here, in this task, I
will describe about the range of available design patterns in the market with relevant to the examples of
creational, structural and behavioral pattern types. Furthermore, this task will also include selection of
appropriate patterns form the range with the series of given scenarios and finally evaluate a range of
design patterns against the range of given scenarios with justification for their selection and purposes.

Discuss a range of design patterns with relevant examples of creational, structural and behavioral
pattern types.

Design Patterns
Advance programming

In software engineering, a design pattern is a general repeatable solution to a commonly occurring


problem in software design. A design pattern isn't a finished design that can be transformed directly into
code. It is a description or template for how to solve a problem that can be used in many different
situations.

Uses of Design Patterns


Design patterns can speed up the development process by providing tested, proven development
paradigms. Effective software design requires considering issues that may not become visible until later
in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major
problems and improves code readability for coders and architects familiar with the patterns. Often,
people only understand how to apply certain software design techniques to certain problems. These
techniques are difficult to apply to a broader range of problems. Design patterns provide general
solutions, documented in a format that doesn't require specifics tied to a particular problem.

In addition, patterns allow developers to communicate using well-known, well understood names for
software interactions. Common design patterns can be improved over time, making them more robust
than ad-hoc designs. (Sourcemaking.com, 2020)

Types of design pattern:

1. Creational design patterns: These design patterns are all about class instantiation. This pattern
can be further divided into class-creation patterns and object-creational patterns. While class-
creation patterns use inheritance effectively in the instantiation process, object-creation patterns
use delegation effectively to get the job done. (Sourcemaking.com, 2020)

 Abstract Factory: Creates an instance of several families of classes


 Builder: Separates object construction from its representation
 Factory Method: Creates an instance of several derived classes
 Object Pool: Avoid expensive acquisition and release of resources by recycling
objects that are no longer in use
 Prototype: A fully initialized instance to be copied or cloned
 Singleton: A class of which only a single instance can exist
Advance programming

Range of creational pattern:


 Suppose a developer wants to create a simple DBConnection class to connect to a database and
wants to access the database at multiple locations from code, generally what developer will do is
create an instance of DBConnection class and use it for doing database operations wherever
required. Which results in creating multiple connections from the database as each instance of
DBConnection class will have a separate connection to the database. In order to deal with it, we
create DBConnection class as a singleton class, so that only one instance of DBConnection is
created and a single connection is established. Because we can manage DB Connection via one
instance so we can control load balance, unnecessary connections, etc.
 Suppose you want to create multiple instances of similar kind and want to achieve loose coupling
then you can go for Factory pattern. A class implementing factory design pattern works as a
bridge between multiple classes. Consider an example of using multiple database servers like
SQL Server and Oracle. If you are developing an application using SQL Server database as back
end, but in future need to change database to oracle, you will need to modify all your code, so as
factory design patterns maintain loose coupling and easy implementation we should go for
factory for achieving loose coupling and creation of similar kind of object.

Example with code:


This example will illustrate the structure of builder design pattern and focus on information such as:
class properties, roles, relation with the elements of pattern.
Advance programming
Advance programming
Advance programming

Here in the above code, we can see the implementation of builder pattern in a program written
with C# in Visual Studio IDE. The first picture illustrates an interface IBuilder with voids
Advance programming

BuildPartA(), BuildPartB() and BuildPartC(), which specifies methods for creating different parts
of the product objects. Then, we have created a concrete builder class that follow the builder
interface and provide specific implementations of the building steps. The concrete builders are
supposed to provide their own methods for retrieving the results since various types of builders
may create entirely different products that won’t follow the same interface. Hence, we cannot
declare such methods in statistical programming languages. Usually, after returning the end result
to the client, a builder instance is expected to be ready to start producing another product. Thus,
we call reset method at the end of the “GetProduct” method body.
It makes sense when we use the builder pattern only when the products are quite complex and
require extensive configurations. In the class product, we have created properties such as list, add
and string ListParts. The concreate builder patterns can produce the unrelated products i.e. results
various builders that maynot have same interface.
The class director is responsible for the execution of building steps in the particular sequence.
This can be helpful when we produce the products according to the specific order of
configuration. However, the director class is optional since the clients directly controls the
builders.
In the class program (where our main function runs), the client code creates a builder object,
passes it to the director and then initiates the construction process and the end result if retrieved
from the builder object.
Output:

The above figure represents output of conceptual example of builder pattern from above code

2. Structural design patterns: These design patterns are all about Class and Object composition.
Advance programming

Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns


define ways to compose objects to obtain new functionality. (Sourcemaking.com, 2020)
 Adapter: Match interfaces of different classes
 Bridge: Separates an object’s interface from its implementation
 Composite: A tree structure of simple and composite objects
 Decorator: Add responsibilities to objects dynamically
 Facade: A single class that represents an entire subsystem
 Flyweight: A fine-grained instance used for efficient sharing
 Private Class Data: Restricts accessor/mutator access
 Proxy: An object representing another object

Range of Structural Design Pattern:


 When 2 interfaces are not compatible with each other and want to make establish a relationship
between them through an adapter its called adapter design pattern. Adapter pattern converts the
interface of a class into another interface or classes the client expects that is adapter lets classes
works together that could not otherwise because of incompatibility. so in these type of
incompatible scenarios, we can go for the adapter pattern.

Example Code:
The code below illustrates the adapter design pattern focusing on answering what classes consist of, their
roles and the relation of the elements in pattern exists.
Advance programming

In the above code, we create an interface named ITarget, where the target defines the domain-
specific interface used by client code. Here, we create a class Adaptee, which contains some
useful behavior, but its interface is incompatible with the existing client code. The Adaptee needs
some adaptation before the client code can use it. Now, create the adapter class that inherits the
ITarget. The adapter thus created makes the Adaptee’s interface compatible with the target’s
interface. In the main class program, when the program executes, we can see that adapter can
translate the target and give the output as shown below.
Output
Advance programming

The above picture shows the output of the given code to illustrate the adapter design pattern.

3. Behavioral design patterns: These design patterns are all about Class's objects communication.
Behavioral patterns are those patterns that are most specifically concerned with communication
between objects. (Sourcemaking.com, 2020)
 Chain of responsibility: A way of passing a request between a chain of objects
 Command: Encapsulate a command request as an object
 Interpreter:A way to include language elements in a program
 Iterator: Sequentially access the elements of a collection
 Mediator: Defines simplified communication between classes
 Memento: Capture and restore an object's internal state
 Null Object: Designed to act as a default value of an object
 Observer: A way of notifying change to a number of classes
 State: Alter an object's behavior when its state changes
 Strategy: Encapsulates an algorithm inside a class
 Template method: Defer the exact steps of an algorithm to a subclass
 Visitor: Defines a new operation to a class without change

Range of Behavioral Design Pattern:


 Template pattern defines the skeleton of an algorithm in an operation deferring some steps to sub-
classes, Template method lets subclasses redefine certain steps of an algorithm without changing
Advance programming

the algorithm structure. say for an example in your project you want the behavior of the module
can be extended, such that we can make the module behave in new and different ways as the
requirements of the application change, or to meet the needs of new applications. However, No
one is allowed to make source code changes to it. it means you can add but can’t modify the
structure in those scenarios a developer can approach template design pattern.

Code example:
The code below illustrates the strategy design pattern focusing on answering what classes consist of,
their roles and the relation of the elements in pattern exists.


Advance programming

In the above code, the context class created that defines the interface of interest to clients. The
context maintains a reference to one of the strategy objects and does not know about the concrete
class of the strategy. It should work with all strategies through strategy interface. A context
accepts a strategy through the constructor, but also provides a setter to change it at runtime. The
SetStrategy function is created as the context allows replacing a strategy object at runtime. The
function DoSomeBusinessLogic represent a context which delegates some work to the strategy
object instead of implementing multiple versions of the algorithm on its own.
Then, an interface is created named IStrategy, which declares operations common to all
supported versions of some algorithms. The context uses this interface to call the algorithms
defined by the concrete strategies.
The concreate strategies ConcreateStrategyA and ConcreateStrategyB are created, which
implement the algorithm while following the base strategy interface (that makes them
interchangeable in the context).
In the main class, the client code picks a concrete strategy and passes it to the context. Here, the
client needs to know about the difference between the strategies to make the right choice. The
above code is then executed and the output is as below.
Advance programming

Output

The above picture shows the output of the given code to illustrate the strategy design pattern.

Article Conclusion

After the implementation of the application for the Cosmos College, we had to investigate the scenario
with respect to the design patterns. Hence, in this task, I had presented the range of design patterns with
relevant examples of creational, structural and behavioral patterns.
Advance programming

References:

1. Developer.com. (2019). Using Design Patterns in UML - Developer.com. [online]


Available at: https://www.developer.com/design/article.php/10925_3309461_2/Using-
Design-Patterns-in-UML.htm [Accessed 29 Dec. 2019].
2. GeeksforGeeks. (2019). MVC Design Pattern - GeeksforGeeks. [online] Available at:
https://www.geeksforgeeks.org/mvc-design-pattern/ [Accessed 29 Dec. 2019].
3. Development, M., Development, M., ERP, D., Bot, F. and Study, C. (2019). Six benefits
of using MVC model for effective web application development. [online] Brainvire.
Available at: https://www.brainvire.com/six-benefits-of-using-mvc-model-for-effective-
web-application-development/ [Accessed 29 Dec. 2019].
4. EDUCBA. (2020). What is OOP? | Principles With Examples | Advantages &
Disadvantages. [online] Available at: https://www.educba.com/what-is-oop/ [Accessed 6
Jan. 2020].
5. Vegibit.com. (2020). C# Relationships Between Classes – Vegibit. [online] Available at:
https://vegibit.com/c-relationships-between-classes/ [Accessed 6 Jan. 2020].
6. Fakhroutdinov, K. (2020). Unified Modeling Language (UML) description, UML
diagram examples, tutorials and reference for all types of UML diagrams - use case
diagrams, class, package, component, composite structure diagrams, deployments,
activities, interactions, profiles, etc.. [online] Uml-diagrams.org. Available at:
https://www.uml-diagrams.org [Accessed 6 Jan. 2020].
7. Sourcemaking.com. (2020). Design Patterns and Refactoring. [online] Available at:
https://sourcemaking.com/design_patterns [Accessed 6 Jan. 2020].

You might also like