PHP Objects, Patterns and Practice (3rd edition)
CHAPTER 11 ■ PERFORMING AND REPRESENTING TASKS } function getContext() { return $this->context; } function process() { $cmd = ...
CHAPTER 11 ■ PERFORMING AND REPRESENTING TASKS ■Note I will return to the Command pattern in Chapter 12 with a fuller implementa ...
C H A P T E R 12 ■ ■ ■ Enterprise Patterns PHP is first and foremost a language designed for the Web. And since its support for ...
CHAPTER 12 ■ ENTERPRISE PATTERNS The Patterns These are the patterns I explore in this chapter. You may read from start to finis ...
CHAPTER 12 ■ ENTERPRISE PATTERNS The command and control layer processes the request from the user. Based on this analysis, it ...
CHAPTER 12 ■ ENTERPRISE PATTERNS Testing is another good reason for creating systems with separate tiers. Web applications are n ...
CHAPTER 12 ■ ENTERPRISE PATTERNS Remember that the aim of this chapter is to illustrate key enterprise design patterns and not t ...
CHAPTER 12 ■ ENTERPRISE PATTERNS Acquiring the information is easy enough, but how would I get it to the data layer where it is ...
CHAPTER 12 ■ ENTERPRISE PATTERNS } function getRequest() { return $this->request; } function setRequest( Request $request ) { ...
CHAPTER 12 ■ ENTERPRISE PATTERNS The benefit here is that you don’t need to create methods for every object you wish to store an ...
CHAPTER 12 ■ ENTERPRISE PATTERNS When you need to put your system through its paces, you can use test mode to switch in a fake r ...
CHAPTER 12 ■ ENTERPRISE PATTERNS The base class defines two protected methods, get() and set(). They are not available to client ...
CHAPTER 12 ■ ENTERPRISE PATTERNS if ( isset( $this->values[$key] ) ) { return $this->values[$key]; } return null; } protec ...
CHAPTER 12 ■ ENTERPRISE PATTERNS As you can see, this class uses the $_SESSION superglobal to set and retrieve values. I kick of ...
CHAPTER 12 ■ ENTERPRISE PATTERNS static function setDSN( $dsn ) { return self::instance()->set('dsn', $dsn); } } This class u ...
CHAPTER 12 ■ ENTERPRISE PATTERNS } } If you intend to use a variation on this code example, make sure you check out the next sec ...
CHAPTER 12 ■ ENTERPRISE PATTERNS Although serialization is a pretty efficient business in PHP, you should be careful of what you ...
CHAPTER 12 ■ ENTERPRISE PATTERNS be deployed across several points in your system. For this reason, it becomes easy for some par ...
CHAPTER 12 ■ ENTERPRISE PATTERNS function init() { $applicationHelper = ApplicationHelper::instance(); $applicationHelper->in ...
CHAPTER 12 ■ ENTERPRISE PATTERNS return self::$instance; } function init() { $dsn = \woo\base\ApplicationRegistry::getDSN( ); if ...
«
8
9
10
11
12
13
14
15
16
17
»
Free download pdf