Skip to content

Instantly share code, notes, and snippets.

Source

Reasons for using design patterns

Introduction

Following on from a previous article entitled [Why design is Critical to Software Development][1], I would like to tackle a slightly more advanced aspect of software design called Design Patterns. As with my previous article, the idea came about during a discussion concerning the merits of software design with a work colleague. The protagonist of the discussion was of the opinion that Design Patterns are too time consuming to be of use within the field of commercial software development. My intention here is to demonstrate why I believe that to be wrong.

I will not go into any details about the mechanics or implementation of any particular Design Patterns. There are many excellent sources for these available elsewhere.

Source

Reasons for using design patterns

Introduction

Following on from a previous article entitled [Why design is Critical to Software Development][1], I would like to tackle a slightly more advanced aspect of software design called Design Patterns. As with my previous article, the idea came about during a discussion concerning the merits of software design with a work colleague. The protagonist of the discussion was of the opinion that Design Patterns are too time consuming to be of use within the field of commercial software development. My intention here is to demonstrate why I believe that to be wrong.

I will not go into any details about the mechanics or implementation of any particular Design Patterns. There are many excellent sources for these available elsewhere.

Những sai lầm phát triển cơ sở dữ liệu phổ biến được bởi các nhà phát triển ứng dụng là gì?

nguồn https://stackoverflow.com/questions/621884/database-development-mistakes-made-by-application-developers

1. Không sử dụng các chỉ số thích hợp

Đây là một điều khá đơn giản, nhưng nó vẫn xảy ra thường xuyên. Khoá ngoại nên có các chỉ mục cho chúng. Nếu bạn đang sử dụng một trường trong nơi mà bạn nên (có thể) có một chỉ mục trên nó. Các chỉ mục như vậy thường nên bao gồm nhiều cột dựa trên các truy vấn bạn cần thực hiện. 2. Không tuân theo sự toàn vẹn tham chiếu

Cơ sở dữ liệu của bạn có thể thay đổi nhưng nếu cơ sở dữ liệu của bạn c tính toàn vẹn tham chiếu -- có nghĩa là tất cả các khoá ngoại được đảm bảo để trỏ đến một thực thể tồn tại -- bạn nên sử dụng nó.

git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@TinyPoro
TinyPoro / Storing object in binary file
Last active September 3, 2019 07:31
Storing object in binary file
*Note: $obj can be any type of data : object, array, ....
1. Storing object in binary file
//convert obj to binary data
$obj = new Class();
$serialized_data = serialize($obj);
$binary_data = unpack("C*",$serialized_data);
//store binary data in binary file
$file = fopen('binary', 'w+');
@TinyPoro
TinyPoro / Install php full ext
Last active September 3, 2019 07:30
Install php full ext
apt-get -y install php7.1-opcache php7.1-fpm php7.1 php7.1-common php7.1-gd php7.1-mysql php7.1-imap php7.1-cli php7.1-cgi php-pear php-auth php7.1-mcrypt mcrypt imagemagick libruby php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl memcached php-memcache php-imagick php-gettext php7.1-zip php7.1-mbstring
@TinyPoro
TinyPoro / Parse multi form in Python
Last active November 28, 2020 16:35
Parse multi form in Python
def parse_multi_form(form):
data = {}
for url_k in form:
v = form[url_k]
ks = []
while url_k:
if '[' in url_k:
k, r = url_k.split('[', 1)
ks.append(k)
if r[0] == ']':
## html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="wraper">
<div class="main h2000 bg-green">
Phần chính trang web
<br/> Phần chính trang web
public function recurse_copy($src,$dst) {
$dir = opendir($src);
@mkdir($dst);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) ) {
$this->recurse_copy($src . '/' . $file,$dst . '/' . $file);
}
else {
copy($src . '/' . $file,$dst . '/' . $file);
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4