Meta tags:
description= A simple, flexible command bus for PHP.;
Headings (most frequently used words):
it, use, what, is, should, when, introduction, bus, not, command, our, tactician, plugins, started, getting, packages, questions,
Text of the page (most frequently used words):
the (19), #command (17), you (16), #tactician (15), and (13), #that (10), bus (6), can (6), #like (6), #your (6), #service (5), easy (5), #layer (4), use (4), #packages (4), #with (4), when (4), really (4), handler (4), what (4), #flexible (3), class (3), simple (3), this (3), object (3), for (3), purchaseproductcommand (3), plugins (3), library (3), then (3), using (3), commandbus (3), pattern (3), middleware (2), new (2), all (2), models (2), database (2), locking (2), serializer (2), transactions (2), protected (2), extend (2), commands (2), help (2), user (2), but (2), they (2), handle (2), also (2), objects (2), great (2), right (2), application (2), extraordinary (2), not (2), very (2), league (2), introduction (2), should (2), got (2), which (2), menu (2), any (2), fill, commandevents, anything, configure, getting, installation, tweaking, form, drop, update, controllers, favorite, done, take, started, know, doing, presented, plumbing, hide, finding, calling, method, boring, function, stuff, plain, old, php, handlers, are, usually, other, etc, bernard, doctrine, structure, executes, message, match, practice, looks, term, mostly, productid, used, wants, combine, its, job, describes, build, code, public, community, purchaseproducthandler, expects, constructor, assign, logger, container, those, make, neatly, properties, tries, userid, layers, targets, especially, inputs, types, site, talk, part, finally, need, won, offer, much, sounds, familiar, helpful, might, writing, app, standalone, uses, internally, tweak, save, hassle, building, yourself, itself, doesn, small, extra, twitter, jonathan, reinink, copyright, was, created, ross, tuck, find, him, broadway, rosstuck, questions, already, tool, provides, probably, okay, there, too, decorate, behaviors, entire, cover, about, buses, general, features, adding, aims, provide, plugin, common, cool, tasks, logging, way, don, have, put, every, immediately, applies, things, one, fit, capture, intent, stand, comes, forms, libraries, expect, getter, setter, sure, poeaa, good, starting, point, author, did, design, subject, martin, fowler, our,
Text of the page (random words):
tactician a simple flexible command bus our packages tactician a simple flexible command bus presented by the league of extraordinary packages menu hide menu getting started introduction installation tweaking tactician middleware plugins locking commandevents doctrine bernard logger container community plugins introduction what is tactician tactician is a command bus library it tries to make using the command pattern in your application easy and flexible you can use tactician for all types of command inputs but it especially targets service layers what is a command bus the term is mostly used when we combine the command pattern with a service layer its job is to take a command object which describes what the user wants to do and match it to a handler which executes it this can help structure your code neatly in practice it looks like this you build a simple message object like this class purchaseproductcommand protected productid protected userid and constructor to assign those properties and a handler class that expects it class purchaseproducthandler public function handle purchaseproductcommand command use command to update your models etc and then in your controllers you can fill in the command using your favorite form or serializer library then drop it in the commandbus and you re done command new purchaseproductcommand 42 29 commandbus handle command that s it tactician is the commandbus part doing all the plumbing of finding the handler and calling the right method you know the boring stuff commands can be any plain old php object and handlers are usually other objects but can be anything you d like to configure one of the cool things about tactician and command buses in general is that they re really easy to extend with new features by adding middleware tactician aims to provide plugin packages that cover common tasks like logging and database transactions that way you don t have to put it in every handler and it immediately applies to your entire application when should i use it tactician is a great fit if you ve got a service layer if you re not sure what a service layer is martin fowler s poeaa is a good starting point tactician s author also did a talk on the subject commands really help capture user intent they re also a great stand in for the models when it comes to forms or serializer libraries that expect getter setter objects the command bus itself is really easy to decorate with extra behaviors like locking or database transactions so it s very easy to extend with plugins finally if you re writing a standalone library that uses the command pattern internally tactician is really easy to tweak and can save you the hassle of building it yourself if any of that sounds familiar and helpful tactician might be right for you when should i not use it if you ve got a very small app that doesn t need a service layer then tactician won t offer much to you if you re already using a tool that provides a command bus like broadway you re probably okay there too questions tactician was created by ross tuck find him on twitter at rosstuck copyright the league of extraordinary packages site design by jonathan reinink
|