Wednesday, February 23, 2011

Sử dụng Table-Valued Parameter trong SQL Server 2008 và ADO.NET

Table-Valued Parameter đưa ra cho bạn một phương pháp đơn giản để truyền dữ liệu từ ứng dụng vào SQL Server mà không phải thực hiện các vòng lặp hoặc các xử lý dữ liệu logic phức tạp phía server. Bạn có thể chuyển toàn bộ các dòng dữ liệu trong ứng dụng và gửi về server chỉ bằng một tham số đơn của câu lệnh SQL.

Saturday, February 19, 2011

What is SOLID?

SOLID is a collection of best practices object-oriented design principles. The principles when applied together to make a system that is easy to maintain and extend over time. The principles of SOLID are guidelines that can be applied while working on software to remove code smells, to refactor the software's source code until it is both legible and extensible. It may be used with test-driven development, and is part of an overall strategy of agile and adaptive programming.

SOLID is abbreviated by Single Responsibility, Open Closed, Liskov Substitution, Interface Segregation and Dependency Inversion.

1. Single Responsibility Principle: A class or module should have one, and only one, reason to change.

2. Open Closed Principle: Software Entities (Classes, Modules, Functions, and so on) should be open for extension but closed for modification.

3. Liskov Substitution Principle: Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.

4. Interface Segregation Principle: Many client specific interfaces are better than one general purpose interface.

5. Dependency Inversion Principle:

a. High level modules should not depend on low level modules. Both should depend on abstractions.

b. Abstractions should not depend upon details. Details should depend upon abstractions.