mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-03 05:27:29 +02:00
removed delegation as it is not a pattern but merely a concept in OOP
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\More\Delegation;
|
||||
|
||||
class JuniorDeveloper
|
||||
{
|
||||
public function writeBadCode(): string
|
||||
{
|
||||
return 'Some junior developer generated code...';
|
||||
}
|
||||
|
||||
/**
|
||||
* Junior is authorized to call method on TeamLead (real delegation)
|
||||
*/
|
||||
public function writeReallyBadCode(TeamLead $teamLead): string
|
||||
{
|
||||
return $teamLead->writeReallyBadCode();
|
||||
}
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
`Delegation`__
|
||||
==============
|
||||
|
||||
Purpose
|
||||
-------
|
||||
|
||||
Demonstrate the Delegator pattern, where an object, instead of performing one
|
||||
of its stated tasks, delegates that task to an associated helper object. In
|
||||
this case TeamLead professes to writeCode and Usage uses this, while TeamLead
|
||||
delegates writeCode to JuniorDeveloper's writeBadCode function. This inverts
|
||||
the responsibility so that Usage is unknowingly executing writeBadCode.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to see it all tied together.
|
||||
|
||||
UML Diagram
|
||||
-----------
|
||||
|
||||
.. image:: uml/uml.png
|
||||
:alt: Alt Delegation UML Diagram
|
||||
:align: center
|
||||
|
||||
Code
|
||||
----
|
||||
|
||||
You can also find this code on `GitHub`_
|
||||
|
||||
TeamLead.php
|
||||
|
||||
.. literalinclude:: TeamLead.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
JuniorDeveloper.php
|
||||
|
||||
.. literalinclude:: JuniorDeveloper.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
Test
|
||||
----
|
||||
|
||||
Tests/DelegationTest.php
|
||||
|
||||
.. literalinclude:: Tests/DelegationTest.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/Delegation
|
||||
.. __: http://en.wikipedia.org/wiki/Delegation_pattern
|
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\More\Delegation;
|
||||
|
||||
class TeamLead
|
||||
{
|
||||
/**
|
||||
* @var JuniorDeveloper
|
||||
*/
|
||||
private $junior;
|
||||
|
||||
/**
|
||||
* @param JuniorDeveloper $junior
|
||||
*/
|
||||
public function __construct(JuniorDeveloper $junior)
|
||||
{
|
||||
$this->junior = $junior;
|
||||
}
|
||||
|
||||
public function writeCode(): string
|
||||
{
|
||||
return $this->junior->writeBadCode();
|
||||
}
|
||||
|
||||
public function writeBadCode(): string
|
||||
{
|
||||
//note that we are passing $this from teamLead context
|
||||
return $this->junior->writeReallyBadCode($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Junior can call this method
|
||||
*/
|
||||
public function writeReallyBadCode(): string
|
||||
{
|
||||
return 'Even team lead can write bad code...';
|
||||
}
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\More\Delegation\Tests;
|
||||
|
||||
use DesignPatterns\More\Delegation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DelegationTest extends TestCase
|
||||
{
|
||||
public function testTeamLeadCanBlameJuniorForBadCode()
|
||||
{
|
||||
$junior = new Delegation\JuniorDeveloper();
|
||||
$teamLead = new Delegation\TeamLead($junior);
|
||||
|
||||
$this->assertEquals($junior->writeBadCode(), $teamLead->writeCode());
|
||||
}
|
||||
|
||||
public function testTeamLeadCanWriteBadCode()
|
||||
{
|
||||
$junior = new Delegation\JuniorDeveloper();
|
||||
$teamLead = new Delegation\TeamLead($junior);
|
||||
|
||||
$this->assertEquals($junior->writeReallyBadCode($teamLead), $teamLead->writeBadCode());
|
||||
}
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Diagram>
|
||||
<ID>PHP</ID>
|
||||
<OriginalElement>\DesignPatterns\More\Delegation\JuniorDeveloper</OriginalElement>
|
||||
<nodes>
|
||||
<node x="-8.0" y="134.0">\DesignPatterns\More\Delegation\JuniorDeveloper</node>
|
||||
<node x="0.0" y="0.0">\DesignPatterns\More\Delegation\TeamLead</node>
|
||||
</nodes>
|
||||
<notes />
|
||||
<edges />
|
||||
<settings layout="Hierarchic Group" zoom="1.0" x="68.5" y="90.5" />
|
||||
<SelectedNodes />
|
||||
<Categories>
|
||||
<Category>Fields</Category>
|
||||
<Category>Constants</Category>
|
||||
<Category>Constructors</Category>
|
||||
<Category>Methods</Category>
|
||||
</Categories>
|
||||
<VISIBILITY>private</VISIBILITY>
|
||||
</Diagram>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 28 KiB |
@@ -1,6 +1,5 @@
|
||||
# More
|
||||
|
||||
* [Delegation](Delegation) [:notebook:](http://en.wikipedia.org/wiki/Delegation_pattern)
|
||||
* [ServiceLocator](ServiceLocator) [:notebook:](http://en.wikipedia.org/wiki/Service_locator_pattern)
|
||||
* [Repository](Repository)
|
||||
* [EAV](EAV) [:notebook:](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model)
|
||||
|
@@ -4,7 +4,6 @@ More
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
|
||||
Delegation/README
|
||||
ServiceLocator/README
|
||||
Repository/README
|
||||
EAV/README
|
||||
|
@@ -88,7 +88,7 @@ The patterns can be structured in roughly three different categories. Please cli
|
||||
* [Visitor](Behavioral/Visitor) [:notebook:](http://en.wikipedia.org/wiki/Visitor_pattern)
|
||||
|
||||
### [More](More)
|
||||
* [Delegation](More/Delegation) [:notebook:](http://en.wikipedia.org/wiki/Delegation_pattern)
|
||||
|
||||
* [ServiceLocator](More/ServiceLocator) [:notebook:](http://en.wikipedia.org/wiki/Service_locator_pattern) (is considered an anti-pattern! :no_entry:)
|
||||
* [Repository](More/Repository)
|
||||
* [EAV](More/EAV) [:notebook:](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model)
|
||||
|
@@ -1,64 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr ""
|
||||
|
@@ -1,64 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr ""
|
||||
|
@@ -1,64 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Puedes encontrar el código en `GitHub`_"
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr ""
|
||||
|
@@ -1,72 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP "
|
||||
"d4972f03fc93de3ef10bb31220de49931487d5e0\n"
|
||||
"POT-Creation-Date: 2016-09-23 12:56-0500\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"X-Generator: Poedit 1.8.9\n"
|
||||
"Last-Translator: Axel Pardemann <axelitusdev@gmail.com>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Language: es_MX\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:1
|
||||
msgid "Delegation"
|
||||
msgstr "Delegación"
|
||||
|
||||
#: ../../More/Delegation/README.rst:4
|
||||
msgid "Purpose"
|
||||
msgstr "Propósito"
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing "
|
||||
"one of its stated tasks, delegates that task to an associated helper object. "
|
||||
"In this case TeamLead professes to writeCode and Usage uses this, while "
|
||||
"TeamLead delegates writeCode to JuniorDeveloper's writeBadCode function. "
|
||||
"This inverts the responsibility so that Usage is unknowingly executing "
|
||||
"writeBadCode."
|
||||
msgstr ""
|
||||
"Demostrar el patrón Delegador, en el cual un objeto, en vez de desempeñar "
|
||||
"una de sus tareas asignadas, delega esta tarea a un objeto de ayuda "
|
||||
"asociado. En este caso *TeamLead* (líder de equipo) establece *writeCode* "
|
||||
"(escribe código) y *Usage* (uso) utiliza esta función, mientras que "
|
||||
"*TeamLead* delega *writeCode* a JuniorDeveloper (desarrolaldor junior) a "
|
||||
"través de la funcióin *writeBadCode* (escribe mal código). Esto invierte la "
|
||||
"responsabilidad de tal manera que *Usage* está ejecutando *writeBadCode* sin "
|
||||
"saberlo."
|
||||
|
||||
#: ../../More/Delegation/README.rst:13
|
||||
msgid "Examples"
|
||||
msgstr "Ejemplos"
|
||||
|
||||
#: ../../More/Delegation/README.rst:16
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to see "
|
||||
"it all tied together."
|
||||
msgstr ""
|
||||
"Por favor revisa JuniorDeveloper.php, TeamLead.php y luego Usage.php para "
|
||||
"ver como se integran en conjunto."
|
||||
|
||||
#: ../../More/Delegation/README.rst:18
|
||||
msgid "UML Diagram"
|
||||
msgstr "Diagrama UML"
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Alt Delegation UML Diagram"
|
||||
msgstr "Alt Diagrama UML Delegacion"
|
||||
|
||||
#: ../../More/Delegation/README.rst:25
|
||||
msgid "Code"
|
||||
msgstr "Código"
|
||||
|
||||
#: ../../More/Delegation/README.rst:28
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Puedes encontrar este código también en `GitHub`_"
|
||||
|
||||
#: ../../More/Delegation/README.rst:42
|
||||
msgid "Test"
|
||||
msgstr "Pruebas"
|
@@ -1,72 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Nikita Strelkov <nikita.strelkov@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr "Delegacja (`Delegation`__)"
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr "Przeznaczenie"
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
"Ideą wzorca projektowego Delegacji jest przekazanie zadania, które obiekt delegujący "
|
||||
"powinien wykonać (ze względu na zdefiniowaną w nim metodę) do innego, powiązanego "
|
||||
"obiektu, który to zadanie wykonuje. W tym przykładzie klasa ``TeamLead`` posiada metodę "
|
||||
"``writeCode()``, która jest wykorzystywana w klasie ``DelegationTest``. Jednak realizacja tej metody "
|
||||
"tak na prawdę odbywa się poprzez metodę ``writeBadCode()`` w klasie ``JuniorDeveloper`` - obiekt klasy "
|
||||
"``TeamLead`` wykonanie tej metody deleguje na obiekt klasy ``JuniorDeveloper``. W ten sposób test nieświadomie "
|
||||
"uruchamia metodę ``writeBadCode()``."
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr "Przykłady"
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
"Sprawdź zawartość klasy ``JuniorDeveloper``, ``TeamLead`` oraz ``DelegationTest``, "
|
||||
"aby zapoznać się z ideą działania tego wzorca."
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr "Diagram UML"
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr "Kod"
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Ten kod znajdziesz również na `GitHub`_."
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr "Testy"
|
@@ -1,69 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: 2017-08-21 23:09-0300\n"
|
||||
"Last-Translator: Leonam Pereira Dias <leonam.pd@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr "`Delegação`__"
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr "Objetivo"
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr "Demonstrar o padrão Delegação (Delegator) onde, um objeto, ao invés de executar"
|
||||
" uma de suas tarefas definidas, delega essa tarefa a um objeto associado. "
|
||||
" Neste caso TeamLead declara writeCode e Usage o usa,"
|
||||
" enquanto TeamLead delega writeCode ao método writeBadCode de JuniorDeveloper. "
|
||||
" Esta implementação inverte a responsabilidade de modo que Usage não tem conhecimento da "
|
||||
" execução do método writeBadCode."
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr "Exemplos"
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr "Por favor, veja JuniorDeveloper.php, TeamLead.php e depois Usage.php para "
|
||||
"ver tudo de maneira conjunta"
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr "Diagrama UML"
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr "Código"
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Você também pode encontrar esse código no `Github`_"
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr ""
|
@@ -1,72 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Nikita Strelkov <nikita.strelkov@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr "`Делегирование <https://ru.wikipedia.org/wiki/Шаблон_делегирования>`_ (`Delegation`__)"
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr "Назначение"
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
"В этом примере демонстрируется шаблон 'Делегирование', в котором объект, "
|
||||
"вместо того чтобы выполнять одну из своих поставленных задач, поручает её "
|
||||
"связанному вспомогательному объекту. В рассматриваемом ниже примере объект "
|
||||
"TeamLead должен выполнять задачу writeCode, а объект Usage использовать "
|
||||
"его, но при этом TeamLead перепоручает выполнение задачи writeCode функции "
|
||||
"writeBadCode объекта JuniorDeveloper. Это инвертирует ответственность так, "
|
||||
"что объект Usage не зная того выполняет writeBadCode."
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr "Примеры"
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
"Просмотрите, пожалуйста, сначала JuniorDeveloper.php, TeamLead.php "
|
||||
"и затем Usage.php, чтобы увидеть, как они связаны."
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr "UML Диаграмма"
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr "Код"
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Вы можете найти этот код на `GitHub`_"
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr "Тест"
|
@@ -1,63 +0,0 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"POT-Creation-Date: 2017-12-16 05:32+0300\n"
|
||||
"PO-Revision-Date: 2017-12-16 05:32+0300\n"
|
||||
"Last-Translator: Faruk Zeren\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: tr\n"
|
||||
"Language-Team: Mütercimler\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:1
|
||||
msgid "Delegation"
|
||||
msgstr "Delegation (Görevlendirme)"
|
||||
|
||||
#: ../../More/Delegation/README.rst:4
|
||||
msgid "Purpose"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing one "
|
||||
"of its stated tasks, delegates that task to an associated helper object. In "
|
||||
"this case TeamLead professes to writeCode and Usage uses this, while TeamLead "
|
||||
"delegates writeCode to JuniorDeveloper's writeBadCode function. This inverts "
|
||||
"the responsibility so that Usage is unknowingly executing writeBadCode."
|
||||
msgstr ""
|
||||
"Örnekte gösterilen kodda, bir nesne kendisine belirlenen (defined) görevlerden bir tanesini "
|
||||
"kendisi yapmaz ve görevi ilişkili bir yardımcı nesneye atar. Bu durumda ``TeamLead``, "
|
||||
"``writeCode`` yöntemi ile görevi kabul eder ve ``Usage`` de bunu kullanır. Ancak "
|
||||
"``TeamLead`` uyanıklık yapar :) ve görevi ``JuniorDeveloper`` içerisinden ``writeBadCode`` "
|
||||
"yöntemine atar. Aslında bu, sorumluluğu tersine çevirir ve böylece ``Usage`` farkında olmadan "
|
||||
"``writeBadCode`` yöntemini çalıştırmış olur."
|
||||
|
||||
#: ../../More/Delegation/README.rst:13
|
||||
msgid "Examples"
|
||||
msgstr "Örnekler"
|
||||
|
||||
#: ../../More/Delegation/README.rst:16
|
||||
msgid "Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to see it all tied together."
|
||||
msgstr "Tüm bağlantıları bir arada görebilmek için, önce JuniorDeveloper.php ve TeamLead.php dosyalarını, sonra da Usage (Test) kısmını lütfen dikkatlice inceleyiniz."
|
||||
|
||||
#: ../../More/Delegation/README.rst:18
|
||||
msgid "UML Diagram"
|
||||
msgstr "UML Diyagramı"
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Alt Delegation UML Diagram"
|
||||
msgstr "Alt Delegation UML Diyagramı"
|
||||
|
||||
#: ../../More/Delegation/README.rst:25
|
||||
msgid "Code"
|
||||
msgstr "Kod"
|
||||
|
||||
#: ../../More/Delegation/README.rst:28
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr "Bu kodu `Github`_ üzerinde de bulabilirsiniz."
|
||||
|
||||
#: ../../More/Delegation/README.rst:42
|
||||
msgid "Test"
|
||||
msgstr "Test"
|
@@ -1,64 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2015, Dominik Liebler and contributors
|
||||
# This file is distributed under the same license as the DesignPatternsPHP
|
||||
# package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-03 23:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.3.4\n"
|
||||
|
||||
#: ../../More/Delegation/README.rst:2
|
||||
msgid "`Delegation`__"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:5
|
||||
msgid "Purpose"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:7
|
||||
msgid ""
|
||||
"Demonstrate the Delegator pattern, where an object, instead of performing"
|
||||
" one of its stated tasks, delegates that task to an associated helper "
|
||||
"object. In this case TeamLead professes to writeCode and Usage uses this,"
|
||||
" while TeamLead delegates writeCode to JuniorDeveloper's writeBadCode "
|
||||
"function. This inverts the responsibility so that Usage is unknowingly "
|
||||
"executing writeBadCode."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:10
|
||||
msgid "Examples"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:12
|
||||
msgid ""
|
||||
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to "
|
||||
"see it all tied together."
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:15
|
||||
msgid "UML Diagram"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:22
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:24
|
||||
msgid "You can also find this code on `GitHub`_"
|
||||
msgstr ""
|
||||
|
||||
#: ../../More/Delegation/README.rst:45
|
||||
msgid "Test"
|
||||
msgstr ""
|
||||
|
Reference in New Issue
Block a user