Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PHP Expert

QUESTION 1

(a) A design pattern can be classified by its scope, which specifies whether the pattern applies primarily to classes or objects. Differentiate between class patterns and object patterns.

(b) Explain each of the following Object Oriented Design Principles. In each case give an example of a design pattern that can be used to apply the principle.

a. Program to an ‘interface' not to an Implementation

b. Classes should be opened for extension but closed for modification (Open Close Principle)

c. Principle of Least Knowledge - Talk only to your immediate friends

(c) Developers should be encouraged to learn and use design patterns. Elucidate why.

QUESTION 2

(a) A class instance can be created using new operator. Why should we use creational design prototypes to create objects?

(b) The factory method is one of the mostly used and one of the more robust design patterns. Discuss on the factory pattern's motivation, intent, associated benefits and drawbacks. Also provide a UML diagram to illustrate a typical implementation.

(c) The Abstract Factory pattern is often makes use of Dependency Inversion principle. Explain the term Dependency Inversion.

QUESTION 3

(a) XYZ news agency is a company which gathers news and publishes them to different subscribers. You have been asked to create an application that will allow the agency to inform right away, when event occurs, its subscribers about the occurrence. The subscribers can receive the news in different ways: Emails, SMS, etc. The solution need to be extensively enough to support new types of subscribers (maybe new communication technologies will appear). Identify the most appropriate GOF design pattern for the above task. Using a UML class diagram illustrate an implementation of a possible solution for the above problem.

(b) Differentiate between the Strategy and State design patterns.

(c) The Adapters can be implemented either as Object adapters or class adapters. Briefly describe each of these adapters.

QUESTION 4

(a) Active Record is one of the two data source architectural patterns covered during the course. Describe this pattern, explaining how it works and when to use it.

(b) PHP Frameworks such as CodeIgniter and Zend are all based on the Model View Controller (MVC) pattern. Very often such frameworks make use of the Front Controllers. Using a diagram explain the purpose of Front Controllers.

(c) Briefly describe three reuse anti-patterns and their refactored solution.

PHP , Programming

  • Category:- PHP
  • Reference No.:- M9133720

Have any Question?


Related Questions in PHP

Final project assignment -requirements specifications -1

FINAL PROJECT ASSIGNMENT - REQUIREMENTS / SPECIFICATIONS - 1. For the final project, you will have to make good use of your CMS using PHP and MySQL for the content delivery. You will have to be able to deliver the conten ...

Question using the course software and week one template as

Question: Using the course software and Week One Template as a starting point, create a new HTML webpage and include the following: • Write the code to display your name in the largest-size heading element. • Write the m ...

Question develop a 5-6 page word document that describes

Question: Develop a 5-6 page Word document that describes the design for a small Web site that meets the following specifications. 1. The Web site includes four or more Web pages designed according to current usability g ...

In php write a simple addtion calculator that reads in two

In PHP write a simple addtion calculator that reads in two values and then add them together and display the output. Be sure to validate both inputs and ensure that it can add 0+0 = Sum: 0. The user should be able to inp ...

Question continue to build on the skills of providing web

Question: Continue to build on the skills of providing Web page content and structure with HTML and Web page style and layout using CSS. Demonstrate the skill of creating a dynamic Web page that includes JavaScript clien ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As