Type | FCL Type | Range | Description | CLS |
---|---|---|---|---|
sbyte | System.SByte | -128 to 127 | 8-bit signed integer | No |
byte | System.Byte | 0 to 255 | 8-bit unsigned integer | Yes |
short | System.Int16 | -32,768 to 32,767 | 16-bit signed | Yes |
ushort | System.UInt16 | 0 to 65,535 | 16-bit unsigned integer | No |
int | System.Int32 | -2,147,483,648 to 2,147,483,647 | 32-bit signed integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BmwFactory bmwFactory = new BmwFactory(); | |
OpelFactory opelFactory = new OpelFactory(); | |
MercedesFactory mercedesFactory = new MercedesFactory(); | |
DunyaMarkalari dunyaMarkalari = new DunyaMarkalari(bmwFactory); | |
Console.WriteLine(String.Format("Araba Modeli:{0}, Jant Çapı:{1}", dunyaMarkalari.ArabaModeli(), dunyaMarkalari.JantCapi())); | |
Console.WriteLine(Environment.NewLine); | |
DunyaMarkalari dunyaMarkalari2 = new DunyaMarkalari(opelFactory); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Clientların marka,araba ve jant oluşturmak istediklerinde bu objeyi kullanacaklar | |
/// </summary> | |
public class DunyaMarkalari | |
{ | |
/// <summary> | |
/// oluşturulacak arabayı tuttuğumuz değişken | |
/// </summary> | |
private readonly IAraba _araba; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// BmwFactory Bmw fabrikası gibi düşünebirlirsiniz. | |
/// IMarkaFactory interfaceden Bir tane araba | |
/// ve jant oluşturan methodlarla araba ve jant oluşturuyoruz. | |
/// </summary> | |
public class BmwFactory : IMarkaFactory | |
{ | |
public IAraba ArabaOlustur() | |
{ | |
return new Bmw(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Bmw jantının nesnesini Ijant interfaceden türetiyorum | |
/// </summary> | |
public class BmwJant : IJant | |
{ | |
/// <summary> | |
/// Jant çapını getiren method | |
/// </summary> | |
/// <returns></returns> | |
public int GetJantCapi() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// BMW nesnesi IAraba interfaceden türettim | |
/// </summary> | |
public class Bmw : IAraba | |
{ | |
/// <summary> | |
/// Araba modelini getirir | |
/// </summary> | |
/// <returns></returns> | |
public string GetArabaModeli() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Araba nesnelerimin türetildiği base interface | |
/// </summary> | |
public interface IAraba | |
{ | |
/// <summary> | |
/// Arabanın adını getiren method | |
/// </summary> | |
/// <returns></returns> | |
string GetArabaModeli(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FactoryMethodDesign.AbstractClass; | |
using System; | |
namespace FactoryMethodDesign | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace FactoryMethodDesign.AbstractClass | |
{ | |
/// <summary> | |
/// Creator clasımız objelerin oluşturulmasından sorumlu obje | |
/// </summary> | |
class Creator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace FactoryMethodDesign.AbstractClass | |
{ | |
enum Markalar | |
{ | |
Bmw, | |
Opel, |
NewerOlder