Click here to Skip to main content
15,896,912 members
Articles / Programming Languages / Visual Basic

Design Your Soccer Engine, and Learn How To Apply Design Patterns (Observer, Decorator, Strategy, and Builder Patterns) - Part III and IV

Rate me:
Please Sign up or sign in to vote.
4.87/5 (70 votes)
21 Oct 2009CPOL9 min read 126.4K   607   144  
This article is a continuation of the previous article, and in this article, we will discuss (1) Applying the Strategy pattern to solve design problems related with 'Team' and 'TeamStrategy', and (2) Applying the Decorator pattern to solve design problems related with the 'Player'.
��' Component: The Player class

Public MustInherit Class Player


    'Just give a name for this player

    Private myName As String



    'The property to get/set the name

    Public Property Name() As String

        Get

            Return myName

        End Get

        Set(ByVal Value As String)

            myName = Value

        End Set

    End Property


    'This is the Operation in the component
    'and this will be overrided by concrete components
    Public MustOverride Sub PassBall()

End Class ' END CLASS DEFINITION Player

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#

Comments and Discussions