Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-10-07 (Yesterday) | Not enough user ratings | Total: 1 This week: 1 | All time: 11,457 This week: 41 |
Version | License | PHP version | Categories | |||
facade 1.0 | MIT/X Consortium ... | 5 | PHP 5, Language, Design Patterns |
Description | Author | |
This package implements service classes using the Facade design pattern. |
Sem o Padrão Facade, o controlador de login precisaria interagir diretamente com cada subsistema:
Com o Padrão Facade, toda essa lógica é encapsulada na LoginFacade, proporcionando uma interface única e simplificada para o controlador de login:
+----------------+ +----------------+ +-----------------------+
| LoginFacade |<>------->| AuthService | | EmailService |
+----------------+ +----------------+ +-----------------------+
| +login() | | +authenticate()| | +sendVerificationCode()|
| +confirmCode() | +----------------+ +-----------------------+
| +logout() | |
+----------------+ +----------------+ +----------------+
| | CodeService | | TokenService |
| +----------------+ +----------------+
| |
| |
| |
| +----------------+
| | LogService |
| +----------------+
|
|
v
+----------------+
| Controller |
+----------------+
| +login() |
| +confirmCode() |
+----------------+
O conteudo do repositório é experimental como um modelo apenas para exemplificar em uma aula sobre padrões de projeto e é apenas um modelo que precisa ser expandido. O uso do Padrão Facade neste contexto de login:
Simplifica o controlador, que agora lida apenas com a fachada e não com múltiplos subsistemas. Desacopla os componentes, permitindo alterações internas sem impactar o controlador. Centraliza a lógica de login, facilitando manutenção e extensão.
Files (34) |
File | Role | Description | ||
---|---|---|---|---|
backend (1 directory) | ||||
vendor (1 file, 2 directories) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
index.php | Example | Example script | ||
readme.md | Doc. | Documentation |
Files (34) | / | backend | / | Services |
File | Role | Description |
---|---|---|
AuthService.php | Class | Class source |
CodeService.php | Class | Class source |
EmailService.php | Class | Class source |
LoginFacade.php | Class | Class source |
LogService.php | Class | Class source |
TokenService.php | Class | Class source |
Files (34) | / | vendor |
File | Role | Description | ||
---|---|---|---|---|
composer (11 files) | ||||
firebase (1 directory) | ||||
autoload.php | Aux. | Configuration script |
Files (34) | / | vendor | / | composer |
File | Role | Description |
---|---|---|
autoload_classmap.php | Aux. | Configuration script |
autoload_namespaces.php | Aux. | Configuration script |
autoload_psr4.php | Aux. | Configuration script |
autoload_real.php | Class | Class source |
autoload_static.php | Class | Class source |
ClassLoader.php | Class | Class source |
installed.json | Data | Auxiliary data |
installed.php | Aux. | Configuration script |
InstalledVersions.php | Class | Class source |
LICENSE | Lic. | License text |
platform_check.php | Aux. | Configuration script |
Files (34) | / | vendor | / | firebase | / | php-jwt |
File | Role | Description | ||
---|---|---|---|---|
src (8 files) | ||||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files (34) | / | vendor | / | firebase | / | php-jwt | / | src |
File | Role | Description |
---|---|---|
BeforeValidException.php | Class | Class source |
CachedKeySet.php | Class | Class source |
ExpiredException.php | Class | Class source |
JWK.php | Class | Class source |
JWT.php | Class | Class source |
JWTExceptionWithPayloadInterface.php | Class | Class source |
Key.php | Class | Class source |
SignatureInvalidException.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.