- Qual é o problema com a arquitetura das aplicações atuais?
- Um projeto, na maioria das vezes, é começado pequeno, por uma pessoa e sem saber como será a sua evolução.
- Pode acontecer de novas pessoas entrarem no projeto e não conhecerem as regras que guiam a aplicação.
- Um dos princípios de organização é o MVC ou Model View Controller.
- No MVC a regra de negócio fica na Model, os templates na View e a mediação é feita pelo Controller.
- O MVC não é suficiente para manter uma aplicação com código compreensível durante muito tempo.
- A ideia de utilizar MVC veio de frameworks e a maioria das aplicações estão acopladas de alguma maneira a frameworks.
- Um projeto é iniciado normalmente (1) escolhendo um framework, (2) instalando um esqueleto, (3) removendo códigos de demonstração, (
This file contains 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
tar -xvf archive.tar.gz | |
#Subir o banco no docker com bacup do Atlas: | |
docker run --rm -it -v $PWD:/data/db -p 27017:27017 mongo:3.6 | |
docker run --rm -it -v $PWD:/data/db --memory="5g" --memory-swap="2g" --cpus="2.0" -p 27017:27017 mongo:3.6 |
This file contains 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
import urllib3 | |
import RPi.GPIO as gpio | |
import Adafruit_DHT as dht | |
import time as t | |
gpio.setmode(gpio.BOARD) | |
gpio.setup(32, gpio.OUT) | |
chave = 'TTN9Y84915G60MJY' |
This file contains 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
import logging, time | |
from timer import timed | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
handler = logging.StreamHandler() | |
handler.setLevel(logging.DEBUG) | |
logger.addHandler(handler) |
This file contains 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
#: This gist is supposed to be used when someone else intends to have a simple Maxscale 2.2.X++ setup | |
#: considering a replication cluster. By replication cluster I mean one master and X slaves; in the | |
#: case of this gist, I'm using just one slave, but, you can add as many as you want to add more to the | |
#: below gist. You will notice that Maxscale after setup will be configured using dynamic commands and | |
#: that is the place you will adjust your servers to be created an added to the service+monitor that | |
#: will be created. The service has a listener, here, allocated the mysql/3306 port. | |
###################### SETUP MARIADB OFFICIAL REPO AND MAXSCALE PACKAGES ###################### | |
#: executing the command for the repository setup on servers |
NewerOlder