Qualification - Higher National Diploma in Computing (RQF)
Unit Name - Advanced Programming
Unit Number - Unit 20
Unit level - Level 5
Unit reference number - Y/615/1651
Unit Credit - 15
Assignment Title - Advanced Programming
Learning Outcome 1: Examine the key components related to the object-orientated programming paradigm, analysing design pattern types.
Learning Outcome 2: Design a series of UML class diagrams.
Learning Outcome 3: Implement code applying design patterns.
Learning Outcome 4: Investigate scenarios with respect to design patterns.
Introduction
Programming paradigms are used to solve real-life problems and observe patterns between them. Unlike traditional coding paradigm, object-oriented paradigm adds quality to the code and allows users to reuse and improve the code at any instance. The purpose of this paper is to detail various characteristics of object oriented language and connect it with design pattern. In the subsequent sections, class diagram, sequence diagram, and use case diagram will be presented. The code to handle the given case is also presented in the third section of the paper and test cases are added in the final part.
Take Unit 20 Advanced Programming - Higher National Diploma in Computing (RQF) Assignment Help and We Will Give You A Lot More!
Assignment Brief: You are recently hired by ZedSmart as a Junior Programmer under the trainee apprenticeship program. You have been approached by your line manager who wants you to take lead on demonstrating object oriented programming aspects using a simple game prototype for seven year olds. He wants you to show leadership and logic to your approach on basic object orientated design approaches to making thissimple game, therefore he has allocated some set tasks.
Activity one- Examine the key components related to the object-orientated programming paradigm, analysing design pattern types.
You are to write a report on key components related to object orientated programming paradigms including design analysis and pattern types. In this report you must highlight key programming methodologies such as
• Computational Thinking,
• Encapsulation,
• Polymorphism,
• Constructors and destructors,
• sub objects,
• abstracts and concrete methods,
• Interface and redefinition,
• Containers and generics.
This report must also include a base knowledge on class relationships such as
1. Generalisation, Inheritance, Realisations, Dependency's, Aggregation and Composition.
2. Determine the design patterns from each of the creational, structural and behavioural pattern types
3. Analyse the relationship between OOP paradigm and the design patterns
Are you in need of assistance with your Unit 6 Business Decision Making assignment, along with online tutoring services? This is specifically aimed at Level 5 in Business studies.
Solution: Part 1 Characteristics of object oriented paradigm
The purpose of a programming paradigm is to address a problem with the help of a programming language. Object-oriented paradigm is meant to handle issues and identify boundaries between various phases of the software development lifecycle. There are six characteristics associated with object-oriented paradigm and these are as follows. Inheritance is the first tenet that demonstrates inheritance of properties from parent class to child class. This helps in improving reusability of the code (Ambler, 2004). Single and multi-level inheritance are present in this form. Further, hierarchical inheritance is used in programs involving complex processes and multiple objects.
Encapsulation is another characteristic meant to wrap data variables as well as code present on data methods. This helps in variable declaration with the help of access modifiers that are private or public. There are two advantages of encapsulation. The fields in a class can be switched between modes - read and write. On the other hand, the class will hold control of data stored in each field. If the code needs to be updated at a later time, the class can be altered.
Polymorphism is yet another concept meant to promote code reusability with multiple objectives to identify individual behaviors. This concept enables definition of an interface and has several implementation methodologies such as method overriding and method overloading. Method overloading happens during compile time while overriding occurs during run time.
Abstraction refers to hiding of details and display of essential information to user. This is feasible with the implementation of interface and an abstract class. Interface refers to the duplicate of class or a group of abstract methods including static constants. Classes form objects and in turn, objects make use of methods to enable communication (Ambler, 2004). Aggregation refers to a unique form of association that is present between objects. On the other hand, composition implies a unique form of aggregation where an object containing another object along with a contained object cannot exist in the absence of a container object.
The final concept is generalization which is meant to highlight shared characteristics that exist between multiple classes. These classes are grouped to create a generalized super class. In general, objects experience a ‘is a' relationship in the program. Associative relationship exists between two objects. This approach is used to create a class diagram.
Enjoy Personalised Online BTEC Assignment Help At The Most Affordable Price
Activity two - Design a series of UML class diagrams
Continue with your report and create a UML class diagrams based on your game concept. You are to design three UML diagrams including:
•Class Diagram • Use Case Diagram • Sequence Diagram
Once completed you will also need to identify possible situations where design patterns would be beneficial and then develop the UML diagrams reflecting the design patterns.Include a relationship between the actual OOP paradigm and its corresponding design pattern in this report.
Solution: Part 2 Design patterns
The purpose of using design pattern is to enable flexibility, reusability, and maintenance of the code. With coupled classes, reusability can be achieved. Likewise, design patterns enable essential degree of abstraction thereby resulting in flexibility. There are various forms of design patterns. Creational design pattern is meant to develop instantiation method of objects.
Singleton pattern is one approach that ensures only one instance of a class in virtual machines. This pattern eliminates initiation of a class. The advantage of factory pattern is the ability to code based on the interface output instead of focusing on implementation. This approach offers abstraction between client class and implementation class by involving inheritance approach.
The next type is structural pattern and this approach offers multiple methods to develop class structures. This pattern makes use of multiple inheritance approach to develop class libraries (Douglass, 2002). There are other sub-patterns like decorator pattern, adapter pattern, bridge, and façade pattern. All of these are used based on the class needs and compatibility between various interfaces in a program. However, the actual class does not have negative impacts due to variations in patterns used.
The final method is behavioural design pattern where encapsulating behaviour of objects are carried out with common tasks. It includes algorithms and lists responsibilities that exist between objects. Instead of inheritance, behavioural design pattern makes use of object composition. Based on the interaction, there are sub-patterns like observer, mediator, iterator, and template method. All these patterns influence the way objects traverse across different methods in the data structure. The advantage is the option for clients to access container and its data at any instance.
Activity three - Implement code applying design patterns
You have been asked to implement your game prototype using Python code. You will need to develop the code based on the solution you proposed in the UML diagrams. You need to use an IDE to develop the application that implements few examples of creational, structural and behavioural design patterns.
Evaluate the use of design patterns for the given purpose. Discuss trade- offs / consequences by applying design patterns.
Solution three:
You have been asked to implement your game prototype using Python code. You will need to develop the code based on the solution you proposed in the UML diagrams. You need to use an IDE to develop the application that implements few examples of creational, structural and behavioural design patterns.
Evaluate the use of design patterns for the given purpose. Discuss trade- offs / consequences by applying design patterns.
We are a team of professionals ready to offer you top-notch solutions for your Internet and E-Business assignment at highly competitive rates.
Activity four - Investigate scenarios with respect to design patterns
Finally you are to investigate other game scenarios (Asteroids, Tetris and Pacman) to demonstrate design patterns, you must continue to write your report discussing a range of design patterns with relevant examples of creational, structural and behavioural pattern types. Reconcile the appropriate design patterns and critically evaluate these patterns against a range of scenarios with justification of your choices.
Solution: Design patterns
For the given scenario, Python code is used as it is known to be a flexible programming paradigm that improves reusability. This programming paradigm also provides the option to create multiple representations and also complex objects with one interface. The design pattern chosen here is creational and this can be extended to other methodologies like factory method.
The pattern will begin with the registration of the user followed by collision of various colored blocks. The user gets a chance to see the score and also exit at any instance. This is a simple model and can be extended to hierarchical model when new features are added. For example, the interface may include new features like playing with friends, customizing colors, and new levels of the game. These features will inherit properties related to score and other functionalities.
The pattern will now remain customizable and reusable (Lutz, 2013). This approach is far better than other paradigms because object-oriented methodology is systematic and reduces complexity involved in the case. It also helps in building relationship between complex processes and objects in an environment. This game environment is at the initial stage and this will extend to advanced stages based on the age or market need.
Conclusion
Advance programming is often misunderstood as a complex model that is expensive to implement and complex to understand. The characteristics identified in the first part of this assignment have been used for the subsequent parts. Object oriented programming is an organized approach that is action-oriented and also incorporates logic between processes. In announcing updates to the code, the sequence, class, and use case diagrams will undergo updates but the complexity is not visible. With a clear maintenance plan followed by unit testing, this object-oriented algorithm offers several benefits to the users than anticipated and also promises high quality and performance.