Monday, August 26, 2013

Design Pattern .Lời mở đầu!

Design Pattern là một tứ khá là quan trọng mà mọi lập trình viên muốn giỏi đều phải biết. Được sử dụng thường xuyên trong các ngôn ngữ OOP. Nó sẽ cung cấp cho bạn các "mẫu thiết kế", giải pháp để giải quyết các vấn đề chung, thường gặp trong lập trình. Các vấn đề mà bạn gặp phải có thể bạn sẽ tự nghĩ ra cách giải quyết nhưng có thể nó chưa phải là tối ưu. Design Pattern giúp bạn giải quyết vấn đề một cách tối ưu nhất, cung cấp cho bạn các giải pháp trong lập trình OOP.

Trong Design Pattern có 3 nhóm bao gồm:
   - Creational Pattern (nhóm khởi tạo) gồm : Abstract Factory, Factory Method, Singleton, Builder, Prototype. Nó sẽ giúp bạn trong việt khởi tạo đối tượng, như bạn biết để khởi tạo bạn phải sử dụng từ khóa new, nhóm Creational Pattern sẽ sử dụng một số thủ thuật để khởi tạo đối tượng mà bạn sẽ không nhìn thấy từ khóa này.
   - Structural Pattern (nhóm cấu trúc) gồm : Adapter, Bridge, Composite, Decorator, Facade, Proxy và Flyweight.. Nó dùng để thiết lập, định nghĩa quan hệ giữa các đối tượng.
   - Cuối cùng là nhóm Behavioral Pattern gồm : Interpreter, Template Method, Chain of Responsibility, Command,  Iterator, Mediator, Memento, Observer, State, Strategy và Visitor. Nhóm này dùng trong thực hiện các hành vi của đối tượng.

Design Pattern giúp bạn tái sử dụng mã lệnh và dẽ dàng mở rộng.

Để chuẩn bị học Design Pattern bạn cần phải nắm chắc các khái niệm sau :
   - Bốn đặc tính của OOP : Thừa kế, Đa hình, Trừu tượng, Bao đóng.
   - Khái niệm interface và abstract . Cái này cực kỳ quan trọng, để hiểu và áp dụng 2 khái niệm này có thể sẽ mất một thời gian, nhưng khi bạn nắm chắc nó bạn sẽ thấy nó thực sự cần thiết.
   - Bỏ tư duy theo lối cấu trúc, nâng tư duy hoàn toàn OOP.

Nếu có khó khăn trong công việc chuẩn bị trên, bạn có thể liên hệ mình, mình sẽ cố gắng giúp bổ sung cho bạn những kiến thức cơ bạn trong OOP. Sau khi bạn đã nắm chắc các thứ kể trên, bạn nên bắt tay vào học Design Pattern càng sớm càng tốt. Sau khi biết Design Pattern giúp bạn đặt trình cao mới .

Trong loạt bài về Design Pattern sắp tới, mình sẽ đặt ra 3 câu hỏi : Nó là gì? Khi nào thì áp dụng nó? Và Áp dụng nó như thế nào. Hy vọng các bạn có thể hiểu và áp dụng nó một cách nhanh nhất. Mọi thắc mắc trong bài viết các bạn có thể để lại comment hoặc liên hệ với mình. Một số link về Design pattern :
 - http://www.mif.vu.lt/~donatas/PSArchitekturaProjektavimas/Library/refcards/refcard-designpatterns.pdf

 - http://www.uml.org.cn/c++/pdf/DesignPatterns.pdf

11 comments:

  1. cảm ơn anh. bài viết rất hay ạ.

    ReplyDelete
  2. This is a great inspiring article. I would like to thank you for the efforts you have made in writing this article.Magnificent work.I trust you would not have reservations if I placed a link here?
    autoketing.com, Product discount master, Discount master app

    ReplyDelete
  3. I'm flawed to reveal this page. Given such a great deal of information in it. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.
    autoketing app facebook chat box facebook live chat help

    ReplyDelete
  4. Somebody essentially help to make seriously articles I’d state. This is the very first time I frequented your website page and thus far? I amazed with the analysis you made to make this particular post amazing. Fantastic job!
    email with love online
    apps autoketing
    email with love free

    ReplyDelete
  5. I was surprised when I read the first lines, it made me think about many things, thanks for posting it.
    currency converter box free, currency converter app download, best autoketing app

    ReplyDelete
  6. Your writings are so good.It's very kind of you to share your writings.When I have spare time, I often read your posts.Thanks for sharing your knowledge.
    Ride The Bus Simulator funny game Mommy Elsa Baby Caring play for free game online Tomb Runner

    ReplyDelete
  7. Hi! Thanks for the great information you have provided! I recently found many useful information in your website especially this blog page.Amazing insight you have on this, it's nice to find a website that details so much information about different artists.
    Kick The Buddy game for kids free game Def Island Real Flight Simulator best game for free

    ReplyDelete

  8. play food games
    basketball free game
    soccer games online
    Hi! Thanks for the great information you have provided! I recently found many useful information in your website especially this blog page.Amazing insight you have on this, it's

    ReplyDelete
  9. Thanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family
    miniclip unblocked, a10 games 2019, Jogo quente 2019

    ReplyDelete

  10. Papa Louie
    Arcade Golf: Neon
    Skateboard First Race
    I surely acquiring more difficulties from each surprisingly more little bit of it

    ReplyDelete