Skip to content

Commit 06632d8

Browse files
committed
initial commit
0 parents  commit 06632d8

File tree

204 files changed

+2469
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+2469
-0
lines changed

Creational Patterns/Abstract Factory Pattern/AbstractFactoryPattern/.vs/AbstractFactoryPattern/v15/Server/sqlite3/db.lock

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.438
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractFactoryPattern", "AbstractFactoryPattern\AbstractFactoryPattern.csproj", "{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {0ACCCBA0-1522-4577-8D90-450823E05BA8}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{36286E0A-54E6-4A2A-8D83-ED948D0C7C88}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>AbstractFactoryPattern</RootNamespace>
10+
<AssemblyName>AbstractFactoryPattern</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Command.cs" />
47+
<Compile Include="Connection.cs" />
48+
<Compile Include="DatabaseFactory.cs" />
49+
<Compile Include="DB2Command.cs" />
50+
<Compile Include="DB2Connection.cs" />
51+
<Compile Include="DB2Factory.cs" />
52+
<Compile Include="Factory.cs" />
53+
<Compile Include="InterbaseCommand.cs" />
54+
<Compile Include="InterbaseConnection.cs" />
55+
<Compile Include="InterbaseFactory.cs" />
56+
<Compile Include="Program.cs" />
57+
<Compile Include="Properties\AssemblyInfo.cs" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<None Include="App.config" />
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public abstract class Command
10+
{
11+
public abstract void Execute(string query);
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public abstract class Connection
10+
{
11+
public abstract bool Connect();
12+
public abstract bool DisConnect();
13+
public abstract string State { get; }
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class DB2Command : Command
10+
{
11+
public override void Execute(string query)
12+
{
13+
Console.WriteLine("DB2 Sorgusu Calıstırılır");
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
class DB2Connection : Connection
10+
{
11+
public override string State
12+
{
13+
get { return "Baglanti Durumu"; }
14+
}
15+
16+
public override bool Connect()
17+
{
18+
Console.WriteLine("DB2 Baglaantısı Acılacak");
19+
return true;
20+
}
21+
22+
public override bool DisConnect()
23+
{
24+
Console.WriteLine("DB2 Baglantısı Kapatılacak");
25+
return true;
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class DB2Factory : DatabaseFactory
10+
{
11+
public override Command createCommand()
12+
{
13+
return new DB2Command();
14+
}
15+
16+
public override Connection createConnection()
17+
{
18+
return new DB2Connection();
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public abstract class DatabaseFactory
10+
{
11+
public abstract Connection createConnection();
12+
public abstract Command createCommand();
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class Factory
10+
{
11+
private DatabaseFactory databaseFactory;
12+
private Connection connection;
13+
private Command command;
14+
public Factory(DatabaseFactory databaseFactory)
15+
{
16+
this.databaseFactory = databaseFactory;
17+
this.connection = databaseFactory.createConnection();
18+
this.command = databaseFactory.createCommand();
19+
}
20+
21+
public void Start()
22+
{
23+
connection.Connect();
24+
if (connection.State == "Baglantı Durumu")
25+
command.Execute("Select");
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class InterbaseCommand : Command
10+
{
11+
public override void Execute(string query)
12+
{
13+
Console.WriteLine("Interbase Sorgusu Calıstırılıyor");
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class InterbaseConnection : Connection
10+
{
11+
public override string State
12+
{
13+
get { return "Baglanti Durumu"; }
14+
}
15+
16+
17+
public override bool Connect()
18+
{
19+
Console.WriteLine("Interbase Baglaantısı Acılacak");
20+
return true;
21+
}
22+
23+
public override bool DisConnect()
24+
{
25+
Console.WriteLine("Interbase Baglaantısı Acılacak");
26+
return true;
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
public class InterbaseFactory : DatabaseFactory
10+
{
11+
public override Command createCommand()
12+
{
13+
return new InterbaseCommand();
14+
}
15+
16+
public override Connection createConnection()
17+
{
18+
return new InterbaseConnection();
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AbstractFactoryPattern
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
Factory factory = new Factory(new InterbaseFactory());
14+
factory.Start();
15+
}
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Bir bütünleştirilmiş koda ilişkin Genel Bilgiler aşağıdaki öznitelikler kümesiyle
6+
// denetlenir. Bütünleştirilmiş kod ile ilişkili bilgileri değiştirmek için
7+
// bu öznitelik değerlerini değiştirin.
8+
[assembly: AssemblyTitle("AbstractFactoryPattern")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("AbstractFactoryPattern")]
13+
[assembly: AssemblyCopyright("Copyright © 2019")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// ComVisible özniteliğinin false olarak ayarlanması bu bütünleştirilmiş koddaki türleri
18+
// COM bileşenleri için görünmez yapar. Bu bütünleştirilmiş koddaki bir türe
19+
// erişmeniz gerekirse ComVisible özniteliğini o türde true olarak ayarlayın.
20+
[assembly: ComVisible(false)]
21+
22+
// Bu proje COM'un kullanımına sunulursa, aşağıdaki GUID tür kitaplığının kimliği içindir
23+
[assembly: Guid("36286e0a-54e6-4a2a-8d83-ed948d0c7c88")]
24+
25+
// Bir derlemenin sürüm bilgileri aşağıdaki dört değerden oluşur:
26+
//
27+
// Ana Sürüm
28+
// İkincil Sürüm
29+
// Yapı Numarası
30+
// Düzeltme
31+
//
32+
// Tüm değerleri belirtebilir veya varsayılan Derleme ve Düzeltme Numaralarını kullanmak için
33+
// '*' kullanarak varsayılana ayarlayabilirsiniz:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e58f84fb6ba27f00899beb30ed0713670d12b361
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.csprojAssemblyReference.cache
2+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.csproj.CoreCompileInputs.cache
3+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.exe.config
4+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.exe
5+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\bin\Debug\AbstractFactoryPattern.pdb
6+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.exe
7+
C:\Users\isa\source\Design Patterns\Abstract Factory Pattern\AbstractFactoryPattern\AbstractFactoryPattern\obj\Debug\AbstractFactoryPattern.pdb

Creational Patterns/Abstract Factory Pattern/AbstractFactoryPattern/AbstractFactoryPattern/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

Creational Patterns/Abstract Factory Pattern/AbstractFactoryPattern/AbstractFactoryPattern/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

Creational Patterns/Abstract Factory Pattern/AbstractFactoryPattern/AbstractFactoryPattern/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Abstract Factory Pattern
2+
![DesignPatternNotları](/img/AbstractFactory.jpg)
3+
### Notlar
4+
5+
- ``` Bir personel bilgi sistemi uygulamasında adres ve telefon bilgilerini yönetmeyi planladığımızı varsayalım. ```
6+
7+
- ``` İlk aklımıza gelen Adres ve telefon verilerini tutacak sınıfları yaratmak olacaktır. ```
8+
- ``` Sınıflar girilen bilgileri ve pnların biçimlerini ilgili alanlarda tutar. ```
9+
- ``` Örneğin Kuzey Amerikadaki tüm telefon numaraları 10 haneden oluşacak şekilde ve adres bilgileride belli koşullara dayanarak oluşturulmuştur. ```
10+
- ``` Sınıflarıoluşturduktan kısa bir süre sonra ,adres ve telefon numara bilgileri için olan koşulların başka bir ülke için (Hollanda ,İngiltere vs) düzenlenmesi gerektiğini fark ederiz. ```
11+
- ``` Yani kişisel ağ genişledikçe farklı ülkelerin bilgilerini yönetmemiz gerekecektir. ```
12+
- ``` Sınıfımızın kurallarına eklenen her yenş kod bloğu sınıfı koda boğacak ve sınıfın yönetimini zorlaştıracaktır. ```
13+
- ``` Uygulamamız ve sınıflarımız yeni ülkelerin koşulları eklendikçe kırılganlaşacaktır. ```
14+
- ``` Abstract factory kalıbı ile bunu çözebiliriz. ```
Binary file not shown.

Creational Patterns/Factory Pattern/.vs/Factory Pattern/v15/Server/sqlite3/db.lock

Whitespace-only changes.

0 commit comments

Comments
 (0)