承接 jjanvier/broken-oop 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jjanvier/broken-oop

Composer 安装命令:

composer require jjanvier/broken-oop

包简介

A set of annotations to help describe common OOP problems met during code reads or code reviews.

README 文档

README

"Broken OOP" is a set of annotations to help describe common OOP problems met during code reads or code reviews. Each annotation explains simply and briefly an OOP design flaw. It contains small examples to ease understanding, as well as references to great authors that have already been thinking about that problem.

Motivation

Often, when I review code and I see a bunch of design flaws or glitches that could be fixed or improved, I face two problems:

  1. Explaining clearly why this could be improved can be complex or time-consuming. It's a pitty because a lot of great minds already wrote about that particular flaw.

  2. Sometimes, I have no time to refactor right now, but still, I don't want to lose the fact that this piece of code could be improved. Some other times, due to a lack of knowledge of the project, I don't know all the consequences of such a change, and I'd just like to highlight the problem to the main developer(s).

Thus, "Broken OOP" is an educational tool which aims to create a shared understanding around OOP common design problems.

Inspiration

Having an educational tool is great, but it's useless if it can't be used seamlessly by developers. The primary source of knowledge (both technical and functional) should be the code. Thanks to Cyrille Martraire for his book Living Documentation where he describes how powerful and simple annotations can be for developers.

PHP annotations don't exist out of the box, and the existing implementations are really far from what offers Java for instance; but still, it remains a good simple tool for such a project.

Getting started

Installation

Please, do not use this tool in production, but rather just for development.

composer require --dev "jjanvier/broken-oop"

How to use?

As this project uses Doctrine annotations, it is compatible with many IDE or text editors. Typically, it works with PHPStorm or Eclipse via the Symfony2 Plugin. To know more, please report to the Doctrine annotations' documentation.

That means that by using CTRL+click in your favorite IDE, you should be able to have a look at the annotation and to better understand the problem spotted by your peer.

todo gif with phpstorm

Contribute

Here is the list of rules to follow to add a new annotation:

  • Each annotation should spot a common OOP design flaw.
  • Each annotation should be named after the problem it highlights or by a general principle whose name already emphasizes the problem. It should not be named after its solution.
  • Each annotation must contain a description. The description should remain simple. Its role is just to introduce the problem, not to supplant great blog posts or books.
  • Each annotation must come with several good English free references.
  • Each annotation can come with good non free references, like a book for instance.
  • Each annotation can come with several good non English free references.
  • Each annotation must come with examples in the examples directory:
    • The folder must have the name of the annotation.
    • A file broken.php describes the problem.
    • A file enhanced.php describes a way to fix partially or completely this problem, and only this problem. Please note the file is not called fixed.php on purpose. Sometimes, we'll propose something better, but still not good. Sometimes we'll solve a part of a problem, but another one remains.
    • Those files must be simple OOP examples.
    • The differences between those two files must be the smallest possible.

If needed, it's possible to use targets and attribute types thanks to the flexibility of Doctrine's annotations.

Here is a template of new annotation:

<?php

namespace Jjanvier\BrokenOop;

/**
 * Here goes a simple description of this common OOP design flaw.
 *
 * References:
 *  - First English free reference {@see ...}
 *  - Second English free reference {@see ...}
 *  - First English non free reference {@see ...}
 *  - [French] First French free reference {@see ...}
 *
 * @Annotation
 *
 * @author  Foo Bar
 * @license GNU GPLv3 https://opensource.org/licenses/GPL-3.0
 */
class CommonOOPDesignFlaw
{

}

License

GNU General Public License version 3

jjanvier/broken-oop 适用场景与选型建议

jjanvier/broken-oop 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「OOP」 「design」 「broken OOP」 「flaw」 「design flaw」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 jjanvier/broken-oop 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jjanvier/broken-oop 我们能提供哪些服务?
定制开发 / 二次开发

基于 jjanvier/broken-oop 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GNU
  • 更新时间: 2018-10-16