ZengCode.Com (The Thai Php Framework)  


Home   Download   Manual   About us    

Facebook   


MAIN MENU
News
Php Tips
Android Programming
Design Pattern By PHP
C# using Linq น่าใช้จริงๆ
C# Tips & Technique
C# Design Pattern
Linux Quick Tips
Java & JavaScript Tips
Database & SQL
ZengCode Framework Guide
Zeng Code Code
Programming
IPhone (Tips and Trick)

Download เอกสารที่น่าสนใจ

สวัสดีครับแฟนๆ Madoogun.com ยินดีต้อนรับสู่บ้านใหม่ครับ

ZengCode framework ขอฝากเนื้อฝากตัวกับชาว Developer ทุกท่านด้วยนะครับ
ผู้พัฒนาเองไม่ได้หวังว่ามันจะใช้งานได้ดีขนาดไปเทียบกับจ้างยุทธจักรด้านนี้
ไม่ว่าจะเป็น Prado หรือแม้แต่ Cake ซึ่งนั้นเค้าระดับเทพเรียกพี่แล้วครับ
ผมก็เป็นแค่ Developer ธรรมดา ๆ คนนึงครับ
ที่สร้าง framework ตัวนี้ขึ้นมาก็เพื่อศึกษา และพัฒนาทักษะด้าน OOP ของตัวเอง
อีกทั้งปกติตัวผมเองเขียนโค้ดได้มั่วซั่วมาก ไม่มีระเบียบ อยากเขียนอะไรคิดออกก็เขียน
ไม่มีแบบแผน บางทีกลับมาแก้โค้ดตัวเอง บอกได้คำเดียวว่า เซ็งโครต เซ็ง โครต โครต
และนี่จึงเป็นที่มาของชื่อ framework ของผมครับ
และอีกประเด็นก็เพื่อจุดประการให้พี่น้องชาว Developer ทุกท่าน
ช่วยกันคิดพัฒนาสิ่งต่างๆ เพื่อวงการด้าน IT
ของเราได้ทัดเทียมนานาอารยะประเทศเค้านะคร ับผมขอเป็นจุดเล็กๆจุดนึงที่พร้อมจะมุ่งมั่น
พัฒนาผลงานด้านนี้ต่อไปครับ สู้ๆ นะพี่น้องชาว Developer ทุกท่าน

 


!!!   เสร็จแล้วครับ ZengBatis ORM คลิ๊กเลยครับ !!!
!!!
   ติดจรวดให้เว็บด้วย  ZengCache คลิ๊กเลยครับ !!!

 

แจกโปรแกรมฝึกท่องศัพท์ภาษาอังกฤษกว่า 4000 คำ โปรแกรมจะรันอยู่ด้านบนสุดของจอภาพ
มันจะ random ศัพท์ทุกๆ 10 วินาทีครับ  
Download

 

บทความล่าสุด

 ZengCache มาสร้าง Caching ให้เว็บเพจไวเหมือนติดจรวดกัน  (2010-07-28)

ผมได้สร้าง Simple Cache Page ขึ้นมาใช้งานลองเอาไปใช้ หรือเอาไปแก้ไขดัดแปลงใช้ได้นะครับ
เหมาะสำหรับ หน้า page ที่ไม่ค่อยมีการอัพเดทเท่าไหร่เพื่อลด Connection กับ Database
เราสามาราถ set expiration ของ cache file ได้ (หน่วยเป็นนาทีครับ)
และเมื่อมีการ post ค่าข้อมูล cache ก็จะหมดอายุโดยอัตโนมัติ นำไปใช้กับพวก กระดานข่าวอะไรได้ครับ
สำหรับ Cache File ผมจะเก็บเป็น Text File นะครับ
สำหรับ Version หน้าผมจะสร้าง DB Cache ด้วยครับ คอยติดตามกันต่อไปนะครับ

 <?php
    /*************************************
    Chiwa Kantawong
    http://www.zengcode.com
    p@zengcode.com
    20 July 2010
    *************************************/
header('Content-type: text/html; charset=utf-8');
Class ZengCache
{
    public static $cachePath;
    public static $cacheTime = 5; //seconds
    public static $cacheName;
    public static $showLoadTime = false;
    
    public static function StartCache($path,$time=null)
    {
         if ( ZengCache::$showLoadTime == true )
            {
              $starttime = explode(' ', microtime());  
              $starttime =  $starttime[1] + $starttime[0];
            }
         ob_start();
         if ($_POST) return;
         if ($path == null || $path == "")
             die('!! Cache need save path !!');
         else
             ZengCache::$cachePath = $path;

    ..........................................................

 


อ่านต่อคลิกที่นี้


 Sort List by LINQ  (2010-07-22)

พอดีไปเจอตัวอย่างที่เข้าใจง่ายๆ เลยเอามาแบ่งปันเพื่อนๆ นะครับ
ตัวอย่างนี้เป็นการเรียงลำดับ Collection ของ Class
ในตัวอย่างนี้คือ List ของ  City Class นะครับ

 
public class City
{
    public string Name { get; set; }
    public string Country { get; set; }
}

 .................


อ่านต่อคลิกที่นี้


 มาป้องกัน Cross-Site scripting อันร้ายกาจกันครับ  (2010-07-21)

มาป้องกัน Cross-Site scripting อันร้ายกาจกันครับ
พอดีไปเจอมาช่วยได้เยอะครับ แต่ไม่แน่ใจว่าครอบคลุมหรือเปล่า
ตอนแรกผมก็โดน SQL Injection ด้วยและก็มี script บางตัวหลุด
อย่างที่ไม่คาดคิดว่ามันจะร้ายกาจได้ขนาดนี้ ต้องขอบคุณ พี่ด้า Inpross มากนะครับ
ที่อุตส่าห์นั่งหาสาเหตุกันตั้งนานสองนาน



อ่านต่อคลิกที่นี้


 Ping Remote Machine Port ด้วย C# กันครับ  (2010-07-15)

ผมว่าเด็ดครับถ้ามีโอกาสต้องใช้เอาไปใช้ได้เลยครับ  ใช้งานได้ 100%

using System.Net;
using System.Net.Sockets;


        public static void connect1(string host, int startPort, int finishPort)
        {

            IPAddress[] IPs = Dns.GetHostAddresses(host);
            Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            Console.WriteLine("Establishing Connection to {0}", host);

            for (int curPort = startPort; curPort <= finishPort; curPort++)
            {

                try
                {
                    s.Connect(IPs[0], curPort);
                    Console.WriteLine("Port {0} : opened", curPort);
                }
                catch
                {
                    Console.WriteLine("Port {0} : blocked", curPort);
                }
            }
        }

 


อ่านต่อคลิกที่นี้


 ZengBatis ORM สด ๆ ร้อน ๆ มาแล้วครับ  (2010-07-14)

สำหรับ Blog ID นี้มีไว้สำหรับสอบถามแนะนำติชม การใช้งาน ZengBatis ORM นะครับ
มีอะไรซัดได้เต็มที่นะครับ ผมจะได้ปรับปรุงแก้ไขตัวเอง กดเข้าไปเลยครับ


อ่านต่อคลิกที่นี้


 มาศึกษา JavaScript แบบ OOP กันครับ  (2010-07-07)

ผมทำ workshop ง่ายๆ ขึ้นมาคือทำ Class Vlidation สำหรับ Form
(ตอนนี้เช็คเฉพาะว่ามีค่าหรือเปล่าเท่านั้น simple ๆ ก่อนนะครับ)
มาดูกันก่อนว่าเราจะเขียน JavaScript แบบ OOP ได้อย่างไร

เริ่มกันที่ Class Validation ของผมก่อนนะครับ (ZengValidation.js)

 function Validation()
{
    this.ElementArray = new Array();
    this.ErrorMessage = new Array();

    this.AddElement = function(element,errorMessage) {  
             this.ElementArray.push(element);
             this.ErrorMessage.push(errorMessage);
         }  

   this.Validate = function()
    {
       for(i=0; i<this.ElementArray.length; i++)
        {
             if(document.getElementById(this.ElementArray[i]).value == "")
                {
                 alert(this.ErrorMessage[i]);
                 document.getElementById(this.ElementArray[i]).focus();
                 return false;
                }
        }//for
        return true;
    }//function


}//Validation Class
 

 

...........................


อ่านต่อคลิกที่นี้


 จับเวลาโดยใช้ Javascript   (2010-06-17)

ตัวนี้ใช้แล้ว work ครับ ง่ายๆดี เอาไปใช้กันนะครับ

<div id="remaining">This page will be  refresh in 60 second(s).</div>
<script>
<!--
 var seconds= 60
function display(){
     seconds = seconds - 1
     document.getElementById('remaining').innerHTML = "This page will be  refresh status in " + seconds +" second(s). ";
     if (seconds <= 0)
     {
         window.location = "url.aspx";
         return;
     }
     setTimeout("display()",1000)
}
display()
-->
</script> >

จากตัวอย่างข้างบนผมจับเวลา 60 วินาทีให้ redirect ไปหน้า url.aspx ครับผม


อ่านต่อคลิกที่นี้


 Server.Transfer vs. Response.Redirect  (2010-06-13)

Server.Transfer vs. Response.Redirect เห็นว่าน่าสนใจและบางคนก็ยังสับสนว่าจะใช้อันไหนดี อ่านครับอ่าน

ทีมา http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=15

A common misconception is the difference between Server.Transfer and Response.Redirect in ASP.NET applications. Redirect and Transfer both cause a new page to be processed, but the interaction between the client (web browser) and server (ASP.NET) is different in each situation.

Redirect: A redirect is just a suggestion – it’s like saying to the client “Hey, you might want to look at this”. All you tell the client is the new URL to look at, and if they comply, they do a second request for the new URL.

If you want to pass state from the source page to the new page, you have to pass it either on the URL (such as a database key, or message string), or you can store it in the Session object (caveat: there may be more than one browser window, and they’ll all use the same session object).
............................................................


อ่านต่อคลิกที่นี้


  พัฒนา ASP.NET Applications แบบ High-Performance กัน   (2010-06-13)

พอดีไปเจอบทความดีๆ ที่น่าสนใจจึงนำมาฝากครับ
มาจาก : http://webcache.googleusercontent.com/search?q=cache:NNdK8DMpri8J:www.centinova.com/board/index.php%3Ftopic%3D27.0%3Btopicseen+asp.net+server.trasfer&cd=8&hl=th&ct=clnk&gl=th&lr=lang_th&client=firefox-a

 ในการเขียน ASP.NET Application มีสิ่งสำคัญอย่างหนึ่งที่ต้องคำนึงถึงนั่นคือประสิทธิภาพการทำงานของระบบ ในบทความนี้ผมจะขอแนะนำเบื้องต้นเกี่ยวกับการพัฒนา ASP.NET Application แบบ High-Performance กัน

โดยแบ่งออกเป็น 5 เรื่องหลักๆ
  • Page and Server Control Processing
  • State management
  • Data access
  • Web applications
  • Coding practices

      ........................................................................

 


อ่านต่อคลิกที่นี้


 JAVA ### Create your own tag: a custom tag body (Simple)  (2010-05-12)

ตัวอย่างนี้มีการเข้าถึง HttpContext และ Attribute ด้วยนะคับลองเอาไปประยุกต์กันดูนะครับ
เป็นตัวอย่างที่ทำความเข้าใจได้ไม่ยาก แต่เป็นพื้นฐานที่ดีมากๆ นะผมว่า


โครงสร้างไฟล์ประมาณนี้นะครับ (ใช้ Eclipse)

    1.Simple.tld เป็น Description ของ tag library

    <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
       "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

        <!-- a tab library descriptor -->
    <taglib xmlns="http://java.sun.com/JSP/TagLibraryDescriptor">
      <tlib-version>1.0</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>Mark's Simple Tags</short-name>

      <tag>
        <name>ZengTag</name>
        <tag-class>test.HelloWorldTag</tag-class>
        <body-content>empty</body-content>
        <attribute>
          <name>myName</name>
        </attribute>
      </tag>
    </taglib>


...............


อ่านต่อคลิกที่นี้


 Capture หน้า web page ใช้ compnent webBrowser ใน C#  (2010-05-10)

    Capture หน้า web page ใช้ compnent webBrowser ใน C#

    //อันนี้ create ตอน runtime นะครับ สุดยอดเลยครับเยี่ยมมาก

    private void button3_Click(object sender, EventArgs e)
            {
                web = new WebBrowser();
                web.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(CaptureImage);

                web.Width = 2000;
                web.Height = 1500;
                web.Navigate("http://www.zengcode.com");
            }


            public void CaptureImage(object sender, System.EventArgs e)
            {
                Bitmap bmp = new Bitmap(1000, 1000);
                web.DrawToBitmap(bmp, new Rectangle(web.Location.X, web.Location.Y, web.Width, web.Height));
                bmp.Save("c://test.bmp");

            }



อ่านต่อคลิกที่นี้


 แก้ปัญหาการ Split String เมื่อต้องการ ignore อักขระที่ต้องการแยกอยู่ใน "" (Double Quote)  (2010-04-07)

นั่งปวดหัวอยู่ตั้งนาน ว่าจะจัดการกะมันยังไง พอดีเจอ Code ที่โดนเลยเอามาฝากครับ

 

   static string[] SplitCSV(string s)
        {
            List<string> list = new List<string>();
            StringBuilder work = new StringBuilder();
            for (int i = 0; i < s.Length; i++)
            {
                char c = s[i];
                if (c == '"')
                {
                    int p2;
                    while (true)
                    {
                        p2 = s.IndexOf('"', i + 1);
                        work.Append(s.Substring(i + 1, p2 - i - 1));
                        i = p2;

                        // If this is a double quote, keep going!
                        if (((p2 + 1) < s.Length) && (s[p2 + 1] == '"'))
                        {
                            work.Append('"');
                            i++;

                            // otherwise, this is a single quote, we're done
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (c == ',')
                {
                    list.Add(work.ToString());
                    work.Length = 0;
                }
                else
                {
                    work.Append(c);
                }
            }
            list.Add(work.ToString());
            return list.ToArray();
        }

 เอาไปใช้ดูครับมีประโยชน์มากๆ ผมเจอปัญหานี้บ่อยมากๆๆๆๆๆ


อ่านต่อคลิกที่นี้


 MySql replace string in a query  (2010-04-05)

 the mysql REPLACE function allows all sort of string manipulation, even inside statements :

REPLACE(str,from_str,to_str)

Returns the string str with all occurrences of the string from_str replaced by the string to_str.

 examples :

  • replace string in all records from a table :
     update mytable set myfield =  replace (myfield, "one", "two");
  • display a modified record set
    SELECT REPLACE(myfield, 'one', 'two') from mytable;


more info about string functions on mysql .com, be careful if you're using version 3, some functions appeared with version 4 

http://dev.mysql.com/doc/mysql/en/string-functions.html



อ่านต่อคลิกที่นี้


 ประยุกต์การสร้าง object ตอนรันไทม์กับ polymorphism  (2010-03-17)

จากหัวข้อที่แล้วบางท่านอาจจะมองไม่ออกว่าจะเอาไปใช้งานอย่างไรได้ ผมก็มีตัวอย่างการประยุกต์ใช้ได้อย่างหนึ่ง (ที่คิดออกตอนนี้)
นั่นก็คือนำไปใช้กับ Class ต่างๆ ที่มีคุณสมบัติ polymorphism เพื่อไม่ให้ขาดตอน ลุยกันเลยครับ

 class Animal
    {
        public virtual String Say()
        {
            return "FooFooooooooooooo";
        }//
    }//

    class Dog : Animal
    {
        public override string Say()
        {
            return "Hong Hong";
        }
    }//

    class Cat : Animal
    {
        public override string Say()
        {
            return "Maew Maew";
        }
    }//


    class ObjectFactory
    {
        public object GetObject(String objName)
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            AssemblyName assemblyName = assembly.GetName();
            Type objType = assembly.GetType(assemblyName.Name + "."+objName);
            return Activator.CreateInstance(objType);
        }//
    }//


    class AnimalFactory
    {
        public Animal BuildAnimal(String animalType)
        {
            return (Animal)new ObjectFactory().GetObject(animalType);
        }//
    }//

........


อ่านต่อคลิกที่นี้


 Create Object ตอนรันไทม์ครับ  (2010-03-17)

นี่เป็นวิธีนึงที่สามารถทำได้นะครับ และผมก็ทดลองแล้วว่าทำงานได้จริง

 class SampleClass
    {
        public void Call1(String str)
        {
            MessageBox.Show("Call1 : " + str);
        }//

        public void Call2(String str)
        {
            MessageBox.Show("Call2 : " + str);
        }//

    }////

ต้องการ create object ของ คลาส SampleClass เรียกใช้ Method Call1 ได้ดังนี้ครับ

.........................

 

 

 


อ่านต่อคลิกที่นี้


 Anonymous Method ใน C# คือ ?  (2010-03-17)

Anonamous Method เป็น Feature ใหม่ที่มีขึ้นใน .NET 2.0 คือไม่จำเป็นต้องสร้าง method นั้น ๆ ไว้ แล้วค่อยเรียกใช้มัน แต่สร้างและใช้
method ใหม่ได้ทันทีในที่ต้องการ ดูตัวอย่างต่อไปนี้นะครับ

Button btn;

btn = new Button();
.....
btnAdd.Click += new EventHandler(btn_Click);
......

void btn_Click(object sender, EventArgs e) {
 MessageBox.Show("Hello World");
}

เราสามารถใช้ Feature ด้าน Anonamous Method ได้ดังนี้คือ

Button btn;

btn = new Button();
.....
btnAdd.Click += delegate(object sender, EventArgs e){  MessageBox.Show("Hello World"); }

หรือ จะละทิ้ง signature ของ Anonamous Method ก็ได้

btnAdd.Click += delegate {  MessageBox.Show("Hello World"); }
......


อ่านต่อคลิกที่นี้


 Delegate ใน C#  (2010-03-16)

Delegate คือ อะไร เอาแบบง่ายๆ ก็คือ Delegate เป็น Reference Type ของ Method ไม่ว่าจะเป็น Static Method หรือว่าเป็น
Method ของ Object ใดๆ ลองมาดูตัวอย่างง่ายๆ กันนะครับ

delegate มีความจำเป็นในหลายๆ สถานการณ์ เช่น
* multi-thread: ในภาษา C# เราสามารถวิ่งหลายๆ โปรเซสไปพร้อมๆ กันได้เรียกว่า thread เมื่อจะเริ่ม thread ใหม่เราจำเป็นต้องระบุ method ที่จะให้ไปทำงานโดยอาศัย delegate
* Library: เมื่อสร้างคลาสไลบรารีบ่อยครั้งที่คลาสจำเป็นต้องเรียกกลับไปยังคลาสผู้ขอ ใช้บริการ (class client) ซึ่งทำได้โดยอาศัย delegate เท่านั้น
* Event: โปรแกรมที่ทำงานบนระบบปฏิบัติการ Windows จะพบ event ตลอดเวลา (event-driven programming) เช่นเมื่อผู้ใช้คลิกเมาส์จะมี event Mouse_Click เกิดขึ้น การกำหนดว่าจะให้ไปทำงาน method ใดเมื่อเกิด event จำเป็นต้องอาศัย delegate
(ผมก็ยอมรับว่ายังงง ๆ ที่จะนำไปใช้งาน ยังไม่เคยเอาไปใช้งานจริงๆ ซะที คงต้องมีสักวันเจอกัน Delegate)

1.Delegate ของ Static Method ธรรมด

        //ประกาศ ตัวแทนชื่อ MyDelegate ที่จะทำงานแทน Method ที่ไม่มีการคืนค่าและรับ parameter 1 ตัวมีชนิดเป็น String
        public delegate void MyDelegate(String str);

        public void ShowMyName(String name)
        {
            MessageBox.Show("My name is "+name);
        }//

          //ประกาศตัวแทนของ MyDelegate ชื่อว่า CallDelegate โดยทำหน้าที่แทน Method ที่ชื่อว่า ShowMyName
          MyDelegate CallDelegate = new MyDelegate(ShowMyName);
          CallDelegate("Chiwa");

ผลก็จะมี Message Box ขึ้นโชว์ว่า My name is Chiwa

 ..................


อ่านต่อคลิกที่นี้


 Adapter Pattern  (2010-03-15)

หากว่าเรามี คลาสที่ใช้งานอยุ่ แล้วเรามี คลาสใหม่ที่สร้างมามีความสมารถใหม่(ซึ่งเราซื้อมาไม่สามารถแก้ไขโค้ดได้) เราต้องการคลาสใหม่ที่มี interface
เหมือนคลาสใหม่ที่ซื้อมาและทำงานสอดคล้องกับระบบเก่าที่เรามี(ใช้คลาสเดิม) นี่เลยครับ Adapter Pattern

namespace Adapter
{
    public class CanSwim
    {
        public string Swim()
        {
            return "I am swiming in the pool";
        }
    }//CanSwim

    public class Bird
    {
        public String Fly()
        {
            return "I can fly";
        }
    }//Bird

    public class CanSwimAdapter : Bird
    {
        public CanSwim swimable;
        public CanSwimAdapter(CanSwim swim)
        {
            this.swimable = swim;
        }
    }

}//Adapter

.............


อ่านต่อคลิกที่นี้


 Prototype Pattern  (2010-03-15)

Protype pattern is a pattern for produce new objects from a instance, of the same class, basically clonning objects.
For implement prototype pattern in c#, class must implement ICloneable interface ขออนุญาติไม่แปรนะครับ กัวจะแปลแล้วเข้าใจยากหนักกว่าเดิม

 namespace Prototype
{

public class MyPrototype : ICloneable
{
  public String myName;

  public MyPrototype(String myName)
  {
    this.myName = myName;
  }

  public object Clone()
  {
    MyPrototype newObj = new MyPrototype(this.myName);
    newObj.myName = this.myName;
    return newObj;
  }

}//class
}//Prototype

 ...........................


อ่านต่อคลิกที่นี้


 Builder Pattern  (2010-03-15)

Factory Method ที่ทำหน้าที่สร้าง Object ของ Class ที่ต่างกันแต่มี Super Class เดียวกันมาแล้ว ซึ่งเราทราบแล้วว่าการที่ Object ที่ถูกสร้างจาก Factory Method ต้องมาจาก Super Class เดียวกันนั้น ถือเป็นข้อจำกัดอันหนึ่งของ Factory Method ในบางโอกาส เราจำเป็นต้องใช้ Object ที่เกิดจากการรวมตัวกนของหลาย ๆ object การรวมหลาย ๆ object เข้าด้วยกัน ซึ่ง Design Pattern ที่เหมาะแก่การนำไปใช้เพื่อสร้าง Object ในลักษณะนี่เรียกว่า “Builder”

 

 namespace Builder
{
    public abstract class Animal
    {
        public String name;
        public String myFood;
        public String leg;
        public String animalType;
       
       

        public String getInformation()
        {
            return "I am " + this.animalType +"\n"+this.leg+ "\n My name is " + this.name + "\n I eat an " + this.myFood;
        }

    }//Animal

    public class Monkey : Animal
    {

        public Monkey()
        {
            this.animalType = "Monkey";
            this.myFood = "Banana";
        }


    }//Monkey

    public class Bird : Animal
    {
        public Bird()
        {
            this.animalType = "Bird";
            this.myFood = "Worm";
        }

       
    }//Bird


   public abstract class AnimalBuilder
   {
       public Animal aAnimal;
       public abstract void BuildName(String name);
       public abstract void BuildLeg();
   }//AnimalBuilder

   public class MonkeyBuilder : AnimalBuilder
   {
       public MonkeyBuilder()
       {
           aAnimal = new Monkey();
       }

       public override void BuildName(String name)
       {
           aAnimal.name = name;
       }

       public override void BuildLeg()
       {
           aAnimal.leg = "My leg was build for 4 legs "+MonkeyBuilderSpecial.MakeSpecial();
       }
   }//MonkeyBuilder

  public class MonkeyBuilderSpecial
  {
      public static String MakeSpecial()
      {
          return ", but i can walk by 2 legs.";
      }
  }

   public class BirdBuilder : AnimalBuilder
   {
       public BirdBuilder()
       {
           aAnimal = new Bird();
       }

       public override void BuildName(String name)
       {
           aAnimal.name = name;
       }

       public override void BuildLeg()
       {
           aAnimal.leg = "My leg was build for 2 legs";
       }
   }//MonkeyBuilder

    public class AnimalConstructor
    {
        public String name {get; set;}
        public void MakeAnimal(AnimalBuilder animalBuilder)
        {
            animalBuilder.BuildName(this.name);
            animalBuilder.BuildLeg();
        }
    }


}//Builder

..................................

 


อ่านต่อคลิกที่นี้


easy tracking
avis car rental discount code

This page took 0.040522 seconds to load.