Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkP88 committed May 22, 2018
0 parents commit 5acd168
Show file tree
Hide file tree
Showing 989 changed files with 11,418 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
Binary file added 9781484236390.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions AbstractFactoryPattern/AbstractFactoryPattern.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{294C8409-1203-44AA-8360-B4DE5B8382EE}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AbstractFactoryPattern</RootNamespace>
<AssemblyName>AbstractFactoryPattern</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="ClassDiagram1.cd" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
6 changes: 6 additions & 0 deletions AbstractFactoryPattern/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
83 changes: 83 additions & 0 deletions AbstractFactoryPattern/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="AbstractFactoryPattern.WildDog" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="2.5" Y="4" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.WildTiger" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="2.5" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.PetDog" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="0.5" Y="4" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.PetTiger" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="0.5" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.WildAnimalFactory" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="6" Y="1.75" Width="1.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAEAAAAA=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.PetAnimalFactory" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="8" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAEAAAAA=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="AbstractFactoryPattern.Program" Collapsed="true">
<Position X="4.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAA=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
</Class>
<Interface Name="AbstractFactoryPattern.IDog" Collapsed="true">
<Position X="1.5" Y="3" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="AbstractFactoryPattern.ITiger" Collapsed="true">
<Position X="1.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAQ=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="AbstractFactoryPattern.IAnimalFactory" Collapsed="true">
<Position X="7" Y="0.5" Width="1.5" />
<Compartments>
<Compartment Name="Methods" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAEAAAAA=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
</Interface>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>
131 changes: 131 additions & 0 deletions AbstractFactoryPattern/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
using System;


namespace AbstractFactoryPattern
{
public interface IDog
{
void Speak();
void Action();
}

public interface ITiger
{
void Speak();
void Action();
}

#region Wild Animal collections
class WildDog : IDog
{
public void Speak()
{
Console.WriteLine("Wild Dog says: Bow-Wow.");
}
public void Action()
{
Console.WriteLine("Wild Dogs prefer to roam freely in jungles.\n");
}
}
class WildTiger : ITiger
{
public void Speak()
{
Console.WriteLine("Wild Tiger says: Halum.");
}
public void Action()
{
Console.WriteLine("Wild Tigers prefer hunting in jungles.\n");
}
}
#endregion

#region Pet Animal collections
class PetDog : IDog
{
public void Speak()
{
Console.WriteLine("Pet Dog says: Bow-Wow.");
}
public void Action()
{
Console.WriteLine("Pet Dogs prefer to stay at home.\n");
}
}
class PetTiger : ITiger
{
public void Speak()
{
Console.WriteLine("Pet Tiger says: Halum.");
}
public void Action()
{
Console.WriteLine("Pet Tigers play in an animal circus.\n");
}
}
#endregion
//Abstract Factory
public interface IAnimalFactory
{
IDog GetDog();
ITiger GetTiger();
}
//Concrete Factory-Wild Animal Factory
public class WildAnimalFactory : IAnimalFactory
{
public IDog GetDog()
{
return new WildDog();
}

public ITiger GetTiger()
{
return new WildTiger();
}
}
//Concrete Factory-Pet Animal Factory
public class PetAnimalFactory : IAnimalFactory
{
public IDog GetDog()
{
return new PetDog();
}

public ITiger GetTiger()
{
return new PetTiger();
}
}

class Program
{
static void Main(string[] args)
{
Console.WriteLine("***Abstract Factory Pattern Demo***\n");

//Making a wild dog through WildAnimalFactory
IAnimalFactory wildAnimalFactory = new WildAnimalFactory();
IDog wildDog = wildAnimalFactory.GetDog();
wildDog.Speak();
wildDog.Action();
//Making a wild tiger through WildAnimalFactory
ITiger wildTiger = wildAnimalFactory.GetTiger();
wildTiger.Speak();
wildTiger.Action();

Console.WriteLine("******************");

//Making a pet dog through PetAnimalFactory
IAnimalFactory petAnimalFactory = new PetAnimalFactory();
IDog petDog = petAnimalFactory.GetDog();
petDog.Speak();
petDog.Action();
//Making a pet tiger through PetAnimalFactory
ITiger petTiger = petAnimalFactory.GetTiger();
petTiger.Speak();
petTiger.Action();

Console.ReadLine();
}
}
}
36 changes: 36 additions & 0 deletions AbstractFactoryPattern/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AbstractFactoryPattern")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AbstractFactoryPattern")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("294c8409-1203-44aa-8360-b4de5b8382ee")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1184f5fc95fc1a5383b592f4472dab6d640af1d3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.exe.config
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.exe
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.pdb
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.csprojResolveAssemblyReference.cache
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.exe
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.pdb
C:\Feluda_June12,2017Onwards\MyPrograms\CPPprogs\ConsoleApplication1\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.csproj.CoreCompileInputs.cache
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions AbstractFactoryPattern/obj/Debug/CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
367a899032cefccbff740e0133173d3681f6634d
Binary file not shown.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1184f5fc95fc1a5383b592f4472dab6d640af1d3
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 5acd168

Please sign in to comment.