Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monolith - Tek

Monolith - Tek

ost of the PHP that still exists today was written long ago by developers lost to the sands of time. It was written in an era where we didn't have the tools we do today such as Composer, type safety, unit testing, and code standards. Even code that was written recently frequently ignores best practices in order to "get things done". You've been tasked with maintaining a legacy application and would like to modernize it, but the powers that be won't let you rewrite it. This talk will discuss strategies for bringing ancient codebases into the modern age piece-by-piece, covering the pros and cons of microservices, monoliths, and event buses.

Omni Adams

April 23, 2024
Tweet

More Decks by Omni Adams

Other Decks in Technology

Transcript

  1. –DHH “You don’t want to hear that the reason your

    monolith is a spaghetti monster is because you let it become that way, one commit at the time, due to weak habits, pressurized deadlines, or simply sheer lack of competence.” https://m.signalvnoise.com/integrated-systems-for-integrated-programmers/
  2. PHPUnit 8.5.0 by Sebastian Bergmann and contributors. ............................................................... 63 /

    281 ( 22%) ............................................................... 126 / 281 ( 44%) ............................................................... 189 / 281 ( 67%) ............................................................... 252 / 281 ( 89%) ............................. 281 / 281 (100%) Time: 2.83 seconds, Memory: 24.00 MB OK (281 tests, 6 assertions) Code Coverage Report: Summary: Classes: 51.72% (15/29) Methods: 75.83% (91/120) Lines: 55.95% (941/1682)
  3. 1) src/Nether/Object/Prototype.php (visibility_required, class_attributes_separation, indentation_type, class_de fi nition, single_space_around_construct, method_argument_space,

    fully_quali fi ed_strict_types, no_spaces_after_function_name, declare_strict_types, blank_line_after_opening_tag, control_structure_braces, constant_case, control_structure_continuation_position, magic_method_casing, ordered_traits, yoda_style, braces_position, statement_indentation, no_useless_return, no_extra_blank_lines, ordered_imports, binary_operator_spaces) ---------- begin diff ---------- --- /home/omni/code/object/src/Nether/Object/Prototype.php +++ /home/omni/code/object/src/Nether/Object/Prototype.php @@ -1,194 +1,202 @@ <?php +declare(strict_types=1); + namespace Nether\Object; -use Nether\Object\Prototype\Flags; -use Nether\Object\Prototype\ConstructArgs; use Nether\Object\Package\ClassInfoPackage; +use Nether\Object\Package\MethodInfoPackage; use Nether\Object\Package\PropertyInfoPackage; -use Nether\Object\Package\MethodInfoPackage; +use Nether\Object\Prototype\ConstructArgs; +use Nether\Object\Prototype\Flags; -class Prototype { +class Prototype +{ - use - ClassInfoPackage, - PropertyInfoPackage, - MethodInfoPackage; + use ClassInfoPackage; + use MethodInfoPackage; + use PropertyInfoPackage; - public function - __Construct(array|object|NULL $Raw=NULL, array|object|NULL $Defaults=NULL, int $Flags=0) { + public function __construct(array|object|null $Raw = null, array|object|null $Defaults = null, int $Flags = 0) + {
  4. ------ ---------------------------------------------------------------------- Line requisition.edit.php ------ ---------------------------------------------------------------------- 21 Class Error referenced

    with incorrect case: error. 24 Instantiated class requisition not found. 25 Call to method load_from_database() on an unknown class requisition. 27 Class Error referenced with incorrect case: error. 28 Constant ERR_RECORD_NOT_FOUND not found. 29 Call to an unde fi ned method Error::new_error(). 36 Constant APP_ROOT not found. 199 Constant REQ_TERM_FULL_TIME not found.
  5. Refactoring Breaking up big pieces of code Pulling procedural code

    out to objects Pulling large pieces of functionality out