Tags » Design Patterns

Singleton - Design pattern

This restricts the instantiation of a class to one object.

Implementation in C# Code.

class Phone
  {
    private static Phone _phone;

    protected Phone()
    {

    }

    public static Phone GetPhone()
    {
      if (_phone == null)
      {
        _phone = new Phone();
      }

      return _phone;
    }
  }
  class Program
  {
    static void Main(string[] args)
    {

      Phone phone1 = Phone.GetPhone();
      Phone phone2 = Phone.GetPhone();

      if(phone1 == phone2)
      {
        Console.WriteLine("Same Phone");
      }
      Console.ReadKey();
    }
  }
… 47 more words

Factory Method - Design Pattern

https://en.wikipedia.org/wiki/Factory_method_pattern

Have a separate operation (factory method) for creating an object.

Objects are created by calling a factory method. Sub Classes are written which says which class to instantiate. 159 more words

Factory Design pattern

First, when do you use factory pattern?

1. You use it when you want to create several objects that share a common super class.
2. When you don’t know ahead of time what class object you want you need.
333 more words

Programming

Week 7 - UI Visual Design Patterns

Visual design patterns are more about providing the user the right tools to accomplish their goals. Good UI should strive for a balance of aesthetics and efficient interactivity. 158 more words

Lecture Notes

Week 3 Lecture Notes: Design Patterns for screen

G’day design enthusiasts!

Today’s lecture discussion is on screen design basics: Design Patterns for Screen.

In her introduction, Sarah Waterson highlights the need to consider design for mobile and/or desktop carefully. 594 more words

UWS