├── .gitignore ├── LICENSE ├── MLDesignPatterns-OC ├── MLDesignPatterns-OC.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── MLDesignPatterns-OC │ ├── AbstractFactory │ ├── Door.h │ ├── Door.m │ ├── DoorFactory.h │ ├── DoorInstaller.h │ ├── DoorInstaller.m │ ├── IronDoor.h │ ├── IronDoor.m │ ├── IronDoorFactory.h │ ├── IronDoorFactory.m │ ├── IronDoorInstaller.h │ ├── IronDoorInstaller.m │ ├── WoodDoor.h │ ├── WoodDoor.m │ ├── WoodDoorFactory.h │ ├── WoodDoorFactory.m │ ├── WoodDoorInstaller.h │ └── WoodDoorInstaller.m │ ├── Adapter │ ├── InternationalConference.h │ ├── SpeakChinese.h │ ├── SpeakChinese.m │ ├── SpeakEnglish.h │ ├── SpeakEnglish.m │ ├── Translator.h │ └── Translator.m │ ├── Bridge │ ├── App.h │ ├── BlueTheme.h │ ├── BlueTheme.m │ ├── ChatModule.h │ ├── ChatModule.m │ ├── Module.h │ ├── Module.m │ ├── MyModule.h │ ├── MyModule.m │ ├── RedTheme.h │ ├── RedTheme.m │ ├── Theme.h │ ├── Theme.m │ └── ThemeInfo.h │ ├── Builder │ ├── FiveYuanNoSpicyBuild.h │ ├── FiveYuanNoSpicyBuild.m │ ├── HandWheatCake.h │ ├── HandWheatCake.m │ ├── HandWheatCakeBuilder.h │ ├── Seller.h │ ├── Seller.m │ ├── TenYuanAbnormalSpicyBuild.h │ └── TenYuanAbnormalSpicyBuild.m │ ├── ChainOfResponsibility │ ├── CEO.h │ ├── CEO.m │ ├── CTO.h │ ├── CTO.m │ ├── Leave.h │ ├── Manager.h │ ├── Manager.m │ ├── PM.h │ └── PM.m │ ├── Command │ ├── AbaloneCommand.h │ ├── AbaloneCommand.m │ ├── Command.h │ ├── Command.m │ ├── CommandProtocol.h │ ├── Cook.h │ ├── Cook.m │ ├── LobsterCommand.h │ ├── LobsterCommand.m │ ├── Waiter.h │ └── Waiter.m │ ├── Composite │ ├── File.h │ ├── File.m │ ├── FileSystem.h │ ├── Folder.h │ ├── Folder.m │ ├── HeaderFile.h │ ├── HeaderFile.m │ ├── ImplementationFile.h │ └── ImplementationFile.m │ ├── Decorator │ ├── ChickenBurger.h │ ├── ChickenBurger.m │ ├── Chilli.h │ ├── Chilli.m │ ├── Condiment.h │ ├── Condiment.m │ ├── Egg.h │ ├── Egg.m │ └── Humburger.h │ ├── Facade │ ├── Curtain.h │ ├── Curtain.m │ ├── HouseManager.h │ ├── HouseManager.m │ ├── Light.h │ └── Light.m │ ├── FactoryMethod │ ├── BlackHuman.h │ ├── BlackHuman.m │ ├── BlackHumanFactory.h │ ├── BlackHumanFactory.m │ ├── Human.h │ ├── Human.m │ ├── HumanFactory.h │ ├── NuWa.h │ ├── NuWa.m │ ├── WhiteHuman.h │ ├── WhiteHuman.m │ ├── WhiteHumanFactory.h │ ├── WhiteHumanFactory.m │ ├── YellowHuman.h │ ├── YellowHuman.m │ ├── YellowHumanFactory.h │ └── YellowHumanFactory.m │ ├── Flyweight │ ├── Circle.h │ ├── Circle.m │ ├── FlyweightFactory.h │ ├── FlyweightFactory.m │ └── Shape.h │ ├── Mediator │ ├── ChatRoom.h │ ├── ChatRoom.m │ ├── MediatorProtocol.h │ ├── User.h │ └── User.m │ ├── Memento │ ├── Editor.h │ ├── Editor.m │ ├── EditorMemento.h │ └── EditorMemento.m │ ├── Observer │ ├── JobHunter.h │ ├── JobHunter.m │ ├── JobProvider.h │ ├── JobProvider.m │ ├── ObserverProtocol.h │ └── SubjectProtocol.h │ ├── Prototype │ ├── Company.h │ ├── Company.m │ ├── Employee.h │ ├── Employee.m │ ├── EmployeeDeepCopy.h │ ├── EmployeeDeepCopy.m │ ├── EmployeeShallowCopy.h │ └── EmployeeShallowCopy.m │ ├── Proxy │ ├── Ticket.h │ ├── TicketOutlets.h │ ├── TicketOutlets.m │ ├── TrainStation.h │ └── TrainStation.m │ ├── Singleton │ ├── Singleton.h │ └── Singleton.m │ ├── State │ ├── BallPen.h │ ├── BallPen.m │ ├── DrawProtocol.h │ ├── Pen.h │ ├── Pen.m │ ├── TextEditor.h │ ├── TextEditor.m │ ├── WritingBrush.h │ └── WritingBrush.m │ ├── Strategy │ ├── BubbleSortStrategy.h │ ├── BubbleSortStrategy.m │ ├── QuickSortStrategy.h │ ├── QuickSortStrategy.m │ ├── Sort.h │ ├── Sort.m │ └── StrategyProtocol.h │ ├── TemplateMethod │ ├── AndroidPublish.h │ ├── AndroidPublish.m │ ├── Publish.h │ ├── Publish.m │ ├── PublishProtocol.h │ ├── iOSPublish.h │ └── iOSPublish.m │ ├── Visitor │ ├── ActionProtocol.h │ ├── HalfCupWater.h │ ├── HalfCupWater.m │ ├── NegativePerson.h │ ├── NegativePerson.m │ ├── ObjectStructure.h │ ├── ObjectStructure.m │ ├── PersonProtocol.h │ ├── PositivePerson.h │ └── PositivePerson.m │ └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/objective-c,macos 3 | 4 | ### macOS ### 5 | *.DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | 9 | # Icon must end with two \r 10 | Icon 11 | 12 | 13 | # Thumbnails 14 | ._* 15 | 16 | # Files that might appear in the root of a volume 17 | .DocumentRevisions-V100 18 | .fseventsd 19 | .Spotlight-V100 20 | .TemporaryItems 21 | .Trashes 22 | .VolumeIcon.icns 23 | .com.apple.timemachine.donotpresent 24 | 25 | # Directories potentially created on remote AFP share 26 | .AppleDB 27 | .AppleDesktop 28 | Network Trash Folder 29 | Temporary Items 30 | .apdisk 31 | 32 | ### Objective-C ### 33 | # Xcode 34 | # 35 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 36 | 37 | ## Build generated 38 | build/ 39 | DerivedData/ 40 | 41 | ## Various settings 42 | *.pbxuser 43 | !default.pbxuser 44 | *.mode1v3 45 | !default.mode1v3 46 | *.mode2v3 47 | !default.mode2v3 48 | *.perspectivev3 49 | !default.perspectivev3 50 | xcuserdata/ 51 | 52 | ## Other 53 | *.moved-aside 54 | *.xccheckout 55 | *.xcscmblueprint 56 | 57 | ## Obj-C/Swift specific 58 | *.hmap 59 | *.ipa 60 | *.dSYM.zip 61 | *.dSYM 62 | 63 | # CocoaPods 64 | # 65 | # We recommend against adding the Pods directory to your .gitignore. However 66 | # you should judge for yourself, the pros and cons are mentioned at: 67 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 68 | # 69 | # Pods/ 70 | 71 | # Carthage 72 | # 73 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 74 | # Carthage/Checkouts 75 | 76 | Carthage/Build 77 | 78 | # fastlane 79 | # 80 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 81 | # screenshots whenever they are needed. 82 | # For more information about the recommended setup visit: 83 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 84 | 85 | fastlane/report.xml 86 | fastlane/Preview.html 87 | fastlane/screenshots 88 | fastlane/test_output 89 | 90 | # Code Injection 91 | # 92 | # After new code Injection tools there's a generated folder /iOSInjectionProject 93 | # https://github.com/johnno1962/injectionforxcode 94 | 95 | iOSInjectionProject/ 96 | 97 | ### Objective-C Patch ### 98 | 99 | # End of https://www.gitignore.io/api/objective-c,macos 100 | 101 | # Created by https://www.gitignore.io/api/objective-c,macos 102 | 103 | ### macOS ### 104 | *.DS_Store 105 | .AppleDouble 106 | .LSOverride 107 | 108 | # Icon must end with two \r 109 | Icon 110 | 111 | 112 | # Thumbnails 113 | ._* 114 | 115 | # Files that might appear in the root of a volume 116 | .DocumentRevisions-V100 117 | .fseventsd 118 | .Spotlight-V100 119 | .TemporaryItems 120 | .Trashes 121 | .VolumeIcon.icns 122 | .com.apple.timemachine.donotpresent 123 | 124 | # Directories potentially created on remote AFP share 125 | .AppleDB 126 | .AppleDesktop 127 | Network Trash Folder 128 | Temporary Items 129 | .apdisk 130 | 131 | ### Objective-C ### 132 | # Xcode 133 | # 134 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 135 | 136 | ## Build generated 137 | build/ 138 | DerivedData/ 139 | 140 | ## Various settings 141 | *.pbxuser 142 | !default.pbxuser 143 | *.mode1v3 144 | !default.mode1v3 145 | *.mode2v3 146 | !default.mode2v3 147 | *.perspectivev3 148 | !default.perspectivev3 149 | xcuserdata/ 150 | 151 | ## Other 152 | *.moved-aside 153 | *.xccheckout 154 | *.xcscmblueprint 155 | 156 | ## Obj-C/Swift specific 157 | *.hmap 158 | *.ipa 159 | *.dSYM.zip 160 | *.dSYM 161 | 162 | # CocoaPods 163 | # 164 | # We recommend against adding the Pods directory to your .gitignore. However 165 | # you should judge for yourself, the pros and cons are mentioned at: 166 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 167 | # 168 | # Pods/ 169 | 170 | # Carthage 171 | # 172 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 173 | # Carthage/Checkouts 174 | 175 | Carthage/Build 176 | 177 | # fastlane 178 | # 179 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 180 | # screenshots whenever they are needed. 181 | # For more information about the recommended setup visit: 182 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 183 | 184 | fastlane/report.xml 185 | fastlane/Preview.html 186 | fastlane/screenshots 187 | fastlane/test_output 188 | 189 | # Code Injection 190 | # 191 | # After new code Injection tools there's a generated folder /iOSInjectionProject 192 | # https://github.com/johnno1962/injectionforxcode 193 | 194 | iOSInjectionProject/ 195 | 196 | ### Objective-C Patch ### 197 | 198 | # End of https://www.gitignore.io/api/objective-c,macos 199 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 MaLi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 101484F61F965E6E00D41236 /* BallPen.m in Sources */ = {isa = PBXBuildFile; fileRef = 101484F51F965E6E00D41236 /* BallPen.m */; }; 11 | 101484F91F965EA800D41236 /* Pen.m in Sources */ = {isa = PBXBuildFile; fileRef = 101484F81F965EA800D41236 /* Pen.m */; }; 12 | 101484FC1F965EBF00D41236 /* WritingBrush.m in Sources */ = {isa = PBXBuildFile; fileRef = 101484FB1F965EBF00D41236 /* WritingBrush.m */; }; 13 | 101484FF1F965F4800D41236 /* TextEditor.m in Sources */ = {isa = PBXBuildFile; fileRef = 101484FE1F965F4800D41236 /* TextEditor.m */; }; 14 | 10428FEA1F8D21CB00C67F26 /* Cook.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FE91F8D21CB00C67F26 /* Cook.m */; }; 15 | 10428FED1F8D224100C67F26 /* LobsterCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FEC1F8D224100C67F26 /* LobsterCommand.m */; }; 16 | 10428FF01F8D225A00C67F26 /* AbaloneCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FEF1F8D225A00C67F26 /* AbaloneCommand.m */; }; 17 | 10428FF31F8D22E800C67F26 /* Command.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FF21F8D22E800C67F26 /* Command.m */; }; 18 | 10428FF71F8FC3AD00C67F26 /* ChatRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FF61F8FC3AD00C67F26 /* ChatRoom.m */; }; 19 | 10428FFA1F8FC4A600C67F26 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FF91F8FC4A600C67F26 /* User.m */; }; 20 | 10428FFD1F8FCB4300C67F26 /* JobProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 10428FFC1F8FCB4300C67F26 /* JobProvider.m */; }; 21 | 104290051F8FD05700C67F26 /* JobHunter.m in Sources */ = {isa = PBXBuildFile; fileRef = 104290041F8FD05700C67F26 /* JobHunter.m */; }; 22 | 104290081F94FE2300C67F26 /* EditorMemento.m in Sources */ = {isa = PBXBuildFile; fileRef = 104290071F94FE2300C67F26 /* EditorMemento.m */; }; 23 | 1042900B1F94FEA800C67F26 /* Editor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1042900A1F94FEA800C67F26 /* Editor.m */; }; 24 | 1042900F1F95096B00C67F26 /* BubbleSortStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1042900E1F95096B00C67F26 /* BubbleSortStrategy.m */; }; 25 | 104290121F95097700C67F26 /* QuickSortStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 104290111F95097700C67F26 /* QuickSortStrategy.m */; }; 26 | 104290151F950D1900C67F26 /* Sort.m in Sources */ = {isa = PBXBuildFile; fileRef = 104290141F950D1900C67F26 /* Sort.m */; }; 27 | 1042901A1F951D2100C67F26 /* PositivePerson.m in Sources */ = {isa = PBXBuildFile; fileRef = 104290191F951D2100C67F26 /* PositivePerson.m */; }; 28 | 1042901D1F951D3C00C67F26 /* NegativePerson.m in Sources */ = {isa = PBXBuildFile; fileRef = 1042901C1F951D3C00C67F26 /* NegativePerson.m */; }; 29 | 1049649A1F9522B500651EE2 /* HalfCupWater.m in Sources */ = {isa = PBXBuildFile; fileRef = 104964991F9522B500651EE2 /* HalfCupWater.m */; }; 30 | 1049649D1F95234B00651EE2 /* ObjectStructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 1049649C1F95234B00651EE2 /* ObjectStructure.m */; }; 31 | 104D30E61F5C5CC30092D139 /* ChickenBurger.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30E51F5C5CC30092D139 /* ChickenBurger.m */; }; 32 | 104D30E91F5C5DA60092D139 /* Condiment.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30E81F5C5DA60092D139 /* Condiment.m */; }; 33 | 104D30EC1F5C5E290092D139 /* Chilli.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30EB1F5C5E290092D139 /* Chilli.m */; }; 34 | 104D30EF1F5C5FB00092D139 /* Egg.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30EE1F5C5FB00092D139 /* Egg.m */; }; 35 | 104D30F31F5DB1010092D139 /* Circle.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30F21F5DB1010092D139 /* Circle.m */; }; 36 | 104D30F61F5DB19F0092D139 /* FlyweightFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30F51F5DB19F0092D139 /* FlyweightFactory.m */; }; 37 | 104D30FA1F5DBAB70092D139 /* TrainStation.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30F91F5DBAB70092D139 /* TrainStation.m */; }; 38 | 104D30FD1F5DBAF90092D139 /* TicketOutlets.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D30FC1F5DBAF90092D139 /* TicketOutlets.m */; }; 39 | 104D31041F619F8B0092D139 /* Manager.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D31031F619F8B0092D139 /* Manager.m */; }; 40 | 104D31071F619F9D0092D139 /* CEO.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D31061F619F9D0092D139 /* CEO.m */; }; 41 | 104D310A1F61A0FC0092D139 /* CTO.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D31091F61A0FC0092D139 /* CTO.m */; }; 42 | 104D310D1F61A27B0092D139 /* PM.m in Sources */ = {isa = PBXBuildFile; fileRef = 104D310C1F61A27B0092D139 /* PM.m */; }; 43 | 104FB0011F55BE1A00085793 /* SpeakEnglish.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0001F55BE1A00085793 /* SpeakEnglish.m */; }; 44 | 104FB0041F55BE2400085793 /* SpeakChinese.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0031F55BE2400085793 /* SpeakChinese.m */; }; 45 | 104FB0081F55C07C00085793 /* Translator.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0071F55C07C00085793 /* Translator.m */; }; 46 | 104FB00F1F55CBB800085793 /* MyModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB00E1F55CBB800085793 /* MyModule.m */; }; 47 | 104FB0121F55CBEB00085793 /* ChatModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0111F55CBEB00085793 /* ChatModule.m */; }; 48 | 104FB0161F55CC7800085793 /* RedTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0151F55CC7800085793 /* RedTheme.m */; }; 49 | 104FB0191F55CC8700085793 /* BlueTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0181F55CC8700085793 /* BlueTheme.m */; }; 50 | 104FB01C1F55CDC200085793 /* Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB01B1F55CDC200085793 /* Module.m */; }; 51 | 104FB0211F55CF1300085793 /* Theme.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0201F55CF1300085793 /* Theme.m */; }; 52 | 104FB0241F599A2F00085793 /* HouseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0231F599A2F00085793 /* HouseManager.m */; }; 53 | 104FB0271F599A3900085793 /* Light.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0261F599A3900085793 /* Light.m */; }; 54 | 104FB02A1F599A6000085793 /* Curtain.m in Sources */ = {isa = PBXBuildFile; fileRef = 104FB0291F599A6000085793 /* Curtain.m */; }; 55 | 1079389D1F3B7529000F287A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1079389C1F3B7529000F287A /* main.m */; }; 56 | 109400321F3CC4B70026A0BB /* Employee.m in Sources */ = {isa = PBXBuildFile; fileRef = 109400311F3CC4B70026A0BB /* Employee.m */; }; 57 | 109400351F3CC62E0026A0BB /* Company.m in Sources */ = {isa = PBXBuildFile; fileRef = 109400341F3CC62E0026A0BB /* Company.m */; }; 58 | 109400381F41DF430026A0BB /* EmployeeDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 109400371F41DF430026A0BB /* EmployeeDeepCopy.m */; }; 59 | 1094003B1F41DF5A0026A0BB /* EmployeeShallowCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1094003A1F41DF5A0026A0BB /* EmployeeShallowCopy.m */; }; 60 | 109400481F42025E0026A0BB /* Singleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 109400471F42025E0026A0BB /* Singleton.m */; }; 61 | 10D3852E1F4497020095A417 /* Human.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D3852D1F4497020095A417 /* Human.m */; }; 62 | 10D385351F4497120095A417 /* BlackHuman.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385301F4497120095A417 /* BlackHuman.m */; }; 63 | 10D385361F4497120095A417 /* WhiteHuman.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385321F4497120095A417 /* WhiteHuman.m */; }; 64 | 10D385371F4497120095A417 /* YellowHuman.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385341F4497120095A417 /* YellowHuman.m */; }; 65 | 10D3853A1F44971B0095A417 /* NuWa.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385391F44971B0095A417 /* NuWa.m */; }; 66 | 10D3853D1F4497260095A417 /* WhiteHumanFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D3853C1F4497260095A417 /* WhiteHumanFactory.m */; }; 67 | 10D385401F4497C30095A417 /* YellowHumanFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D3853F1F4497C30095A417 /* YellowHumanFactory.m */; }; 68 | 10D385441F4499330095A417 /* BlackHumanFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385431F4499330095A417 /* BlackHumanFactory.m */; }; 69 | 10D385C91F4B2DD20095A417 /* WoodDoor.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385C81F4B2DD20095A417 /* WoodDoor.m */; }; 70 | 10D385CC1F4B2DF80095A417 /* IronDoor.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385CB1F4B2DF80095A417 /* IronDoor.m */; }; 71 | 10D385D31F4B2E890095A417 /* WoodDoorInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385D21F4B2E890095A417 /* WoodDoorInstaller.m */; }; 72 | 10D385D61F4B2E950095A417 /* IronDoorInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385D51F4B2E950095A417 /* IronDoorInstaller.m */; }; 73 | 10D385DC1F4B32870095A417 /* WoodDoorFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385DB1F4B32870095A417 /* WoodDoorFactory.m */; }; 74 | 10D385DF1F4B32F70095A417 /* IronDoorFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385DE1F4B32F70095A417 /* IronDoorFactory.m */; }; 75 | 10D385E21F4B34010095A417 /* Door.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385E11F4B34010095A417 /* Door.m */; }; 76 | 10D385E51F4B343B0095A417 /* DoorInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385E41F4B343B0095A417 /* DoorInstaller.m */; }; 77 | 10D385E81F4B3EA90095A417 /* HandWheatCake.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385E71F4B3EA90095A417 /* HandWheatCake.m */; }; 78 | 10D385EF1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385EE1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.m */; }; 79 | 10D385F21F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385F11F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.m */; }; 80 | 10D385F51F4B43A80095A417 /* Seller.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D385F41F4B43A80095A417 /* Seller.m */; }; 81 | 10F84C4F1F8D1E5F00722C69 /* Waiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 10F84C4E1F8D1E5F00722C69 /* Waiter.m */; }; 82 | 10FDC4011F9527D00083B82A /* Publish.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FDC4001F9527D00083B82A /* Publish.m */; }; 83 | 10FDC4051F9529500083B82A /* AndroidPublish.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FDC4041F9529500083B82A /* AndroidPublish.m */; }; 84 | 10FDC4081F95295A0083B82A /* iOSPublish.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FDC4071F95295A0083B82A /* iOSPublish.m */; }; 85 | 2473BFF91F59108D0018E4A3 /* Folder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2473BFF81F59108D0018E4A3 /* Folder.m */; }; 86 | 2473BFFF1F592A120018E4A3 /* HeaderFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 2473BFFE1F592A120018E4A3 /* HeaderFile.m */; }; 87 | 2473C0041F592A910018E4A3 /* ImplementationFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 2473C0031F592A910018E4A3 /* ImplementationFile.m */; }; 88 | 2473C0071F592BB20018E4A3 /* File.m in Sources */ = {isa = PBXBuildFile; fileRef = 2473C0061F592BB20018E4A3 /* File.m */; }; 89 | /* End PBXBuildFile section */ 90 | 91 | /* Begin PBXCopyFilesBuildPhase section */ 92 | 107938971F3B7529000F287A /* CopyFiles */ = { 93 | isa = PBXCopyFilesBuildPhase; 94 | buildActionMask = 2147483647; 95 | dstPath = /usr/share/man/man1/; 96 | dstSubfolderSpec = 0; 97 | files = ( 98 | ); 99 | runOnlyForDeploymentPostprocessing = 1; 100 | }; 101 | /* End PBXCopyFilesBuildPhase section */ 102 | 103 | /* Begin PBXFileReference section */ 104 | 101484F31F965D9800D41236 /* DrawProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DrawProtocol.h; sourceTree = ""; }; 105 | 101484F41F965E6E00D41236 /* BallPen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BallPen.h; sourceTree = ""; }; 106 | 101484F51F965E6E00D41236 /* BallPen.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BallPen.m; sourceTree = ""; }; 107 | 101484F71F965EA800D41236 /* Pen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Pen.h; sourceTree = ""; }; 108 | 101484F81F965EA800D41236 /* Pen.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Pen.m; sourceTree = ""; }; 109 | 101484FA1F965EBF00D41236 /* WritingBrush.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WritingBrush.h; sourceTree = ""; }; 110 | 101484FB1F965EBF00D41236 /* WritingBrush.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WritingBrush.m; sourceTree = ""; }; 111 | 101484FD1F965F4800D41236 /* TextEditor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextEditor.h; sourceTree = ""; }; 112 | 101484FE1F965F4800D41236 /* TextEditor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TextEditor.m; sourceTree = ""; }; 113 | 10428FE81F8D21CB00C67F26 /* Cook.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cook.h; sourceTree = ""; }; 114 | 10428FE91F8D21CB00C67F26 /* Cook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Cook.m; sourceTree = ""; }; 115 | 10428FEB1F8D224100C67F26 /* LobsterCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LobsterCommand.h; sourceTree = ""; }; 116 | 10428FEC1F8D224100C67F26 /* LobsterCommand.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LobsterCommand.m; sourceTree = ""; }; 117 | 10428FEE1F8D225A00C67F26 /* AbaloneCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AbaloneCommand.h; sourceTree = ""; }; 118 | 10428FEF1F8D225A00C67F26 /* AbaloneCommand.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AbaloneCommand.m; sourceTree = ""; }; 119 | 10428FF11F8D22E800C67F26 /* Command.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Command.h; sourceTree = ""; }; 120 | 10428FF21F8D22E800C67F26 /* Command.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Command.m; sourceTree = ""; }; 121 | 10428FF41F8FC25200C67F26 /* MediatorProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediatorProtocol.h; sourceTree = ""; }; 122 | 10428FF51F8FC3AD00C67F26 /* ChatRoom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatRoom.h; sourceTree = ""; }; 123 | 10428FF61F8FC3AD00C67F26 /* ChatRoom.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatRoom.m; sourceTree = ""; }; 124 | 10428FF81F8FC4A600C67F26 /* User.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = ""; }; 125 | 10428FF91F8FC4A600C67F26 /* User.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = ""; }; 126 | 10428FFB1F8FCB4300C67F26 /* JobProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JobProvider.h; sourceTree = ""; }; 127 | 10428FFC1F8FCB4300C67F26 /* JobProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JobProvider.m; sourceTree = ""; }; 128 | 10428FFE1F8FCD5B00C67F26 /* ObserverProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObserverProtocol.h; sourceTree = ""; }; 129 | 104290021F8FCF3D00C67F26 /* SubjectProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SubjectProtocol.h; sourceTree = ""; }; 130 | 104290031F8FD05700C67F26 /* JobHunter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JobHunter.h; sourceTree = ""; }; 131 | 104290041F8FD05700C67F26 /* JobHunter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JobHunter.m; sourceTree = ""; }; 132 | 104290061F94FE2300C67F26 /* EditorMemento.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EditorMemento.h; sourceTree = ""; }; 133 | 104290071F94FE2300C67F26 /* EditorMemento.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EditorMemento.m; sourceTree = ""; }; 134 | 104290091F94FEA800C67F26 /* Editor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Editor.h; sourceTree = ""; }; 135 | 1042900A1F94FEA800C67F26 /* Editor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Editor.m; sourceTree = ""; }; 136 | 1042900C1F95091400C67F26 /* StrategyProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StrategyProtocol.h; sourceTree = ""; }; 137 | 1042900D1F95096B00C67F26 /* BubbleSortStrategy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BubbleSortStrategy.h; sourceTree = ""; }; 138 | 1042900E1F95096B00C67F26 /* BubbleSortStrategy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BubbleSortStrategy.m; sourceTree = ""; }; 139 | 104290101F95097700C67F26 /* QuickSortStrategy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QuickSortStrategy.h; sourceTree = ""; }; 140 | 104290111F95097700C67F26 /* QuickSortStrategy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QuickSortStrategy.m; sourceTree = ""; }; 141 | 104290131F950D1900C67F26 /* Sort.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Sort.h; sourceTree = ""; }; 142 | 104290141F950D1900C67F26 /* Sort.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Sort.m; sourceTree = ""; }; 143 | 104290161F951CB300C67F26 /* PersonProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersonProtocol.h; sourceTree = ""; }; 144 | 104290171F951CCC00C67F26 /* ActionProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActionProtocol.h; sourceTree = ""; }; 145 | 104290181F951D2100C67F26 /* PositivePerson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PositivePerson.h; sourceTree = ""; }; 146 | 104290191F951D2100C67F26 /* PositivePerson.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PositivePerson.m; sourceTree = ""; }; 147 | 1042901B1F951D3C00C67F26 /* NegativePerson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NegativePerson.h; sourceTree = ""; }; 148 | 1042901C1F951D3C00C67F26 /* NegativePerson.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NegativePerson.m; sourceTree = ""; }; 149 | 104964981F9522B500651EE2 /* HalfCupWater.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HalfCupWater.h; sourceTree = ""; }; 150 | 104964991F9522B500651EE2 /* HalfCupWater.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HalfCupWater.m; sourceTree = ""; }; 151 | 1049649B1F95234B00651EE2 /* ObjectStructure.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectStructure.h; sourceTree = ""; }; 152 | 1049649C1F95234B00651EE2 /* ObjectStructure.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjectStructure.m; sourceTree = ""; }; 153 | 104D30E31F5C5C740092D139 /* Humburger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Humburger.h; sourceTree = ""; }; 154 | 104D30E41F5C5CC30092D139 /* ChickenBurger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChickenBurger.h; sourceTree = ""; }; 155 | 104D30E51F5C5CC30092D139 /* ChickenBurger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChickenBurger.m; sourceTree = ""; }; 156 | 104D30E71F5C5DA60092D139 /* Condiment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Condiment.h; sourceTree = ""; }; 157 | 104D30E81F5C5DA60092D139 /* Condiment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Condiment.m; sourceTree = ""; }; 158 | 104D30EA1F5C5E290092D139 /* Chilli.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chilli.h; sourceTree = ""; }; 159 | 104D30EB1F5C5E290092D139 /* Chilli.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Chilli.m; sourceTree = ""; }; 160 | 104D30ED1F5C5FB00092D139 /* Egg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Egg.h; sourceTree = ""; }; 161 | 104D30EE1F5C5FB00092D139 /* Egg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Egg.m; sourceTree = ""; }; 162 | 104D30F01F5DB0CE0092D139 /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = ""; }; 163 | 104D30F11F5DB1010092D139 /* Circle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Circle.h; sourceTree = ""; }; 164 | 104D30F21F5DB1010092D139 /* Circle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Circle.m; sourceTree = ""; }; 165 | 104D30F41F5DB19F0092D139 /* FlyweightFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlyweightFactory.h; sourceTree = ""; }; 166 | 104D30F51F5DB19F0092D139 /* FlyweightFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlyweightFactory.m; sourceTree = ""; }; 167 | 104D30F71F5DBA770092D139 /* Ticket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ticket.h; sourceTree = ""; }; 168 | 104D30F81F5DBAB70092D139 /* TrainStation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrainStation.h; sourceTree = ""; }; 169 | 104D30F91F5DBAB70092D139 /* TrainStation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TrainStation.m; sourceTree = ""; }; 170 | 104D30FB1F5DBAF90092D139 /* TicketOutlets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TicketOutlets.h; sourceTree = ""; }; 171 | 104D30FC1F5DBAF90092D139 /* TicketOutlets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TicketOutlets.m; sourceTree = ""; }; 172 | 104D30FE1F619CC90092D139 /* Leave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Leave.h; sourceTree = ""; }; 173 | 104D31021F619F8B0092D139 /* Manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Manager.h; sourceTree = ""; }; 174 | 104D31031F619F8B0092D139 /* Manager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Manager.m; sourceTree = ""; }; 175 | 104D31051F619F9D0092D139 /* CEO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEO.h; sourceTree = ""; }; 176 | 104D31061F619F9D0092D139 /* CEO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEO.m; sourceTree = ""; }; 177 | 104D31081F61A0FC0092D139 /* CTO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTO.h; sourceTree = ""; }; 178 | 104D31091F61A0FC0092D139 /* CTO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTO.m; sourceTree = ""; }; 179 | 104D310B1F61A27B0092D139 /* PM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PM.h; sourceTree = ""; }; 180 | 104D310C1F61A27B0092D139 /* PM.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PM.m; sourceTree = ""; }; 181 | 104FAFFF1F55BE1A00085793 /* SpeakEnglish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeakEnglish.h; sourceTree = ""; }; 182 | 104FB0001F55BE1A00085793 /* SpeakEnglish.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeakEnglish.m; sourceTree = ""; }; 183 | 104FB0021F55BE2400085793 /* SpeakChinese.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeakChinese.h; sourceTree = ""; }; 184 | 104FB0031F55BE2400085793 /* SpeakChinese.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeakChinese.m; sourceTree = ""; }; 185 | 104FB0051F55BEC600085793 /* InternationalConference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InternationalConference.h; sourceTree = ""; }; 186 | 104FB0061F55C07C00085793 /* Translator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Translator.h; sourceTree = ""; }; 187 | 104FB0071F55C07C00085793 /* Translator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Translator.m; sourceTree = ""; }; 188 | 104FB00C1F55CB3800085793 /* App.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = App.h; sourceTree = ""; }; 189 | 104FB00D1F55CBB800085793 /* MyModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyModule.h; sourceTree = ""; }; 190 | 104FB00E1F55CBB800085793 /* MyModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyModule.m; sourceTree = ""; }; 191 | 104FB0101F55CBEB00085793 /* ChatModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatModule.h; sourceTree = ""; }; 192 | 104FB0111F55CBEB00085793 /* ChatModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatModule.m; sourceTree = ""; }; 193 | 104FB0131F55CC6B00085793 /* ThemeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemeInfo.h; sourceTree = ""; }; 194 | 104FB0141F55CC7800085793 /* RedTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedTheme.h; sourceTree = ""; }; 195 | 104FB0151F55CC7800085793 /* RedTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RedTheme.m; sourceTree = ""; }; 196 | 104FB0171F55CC8700085793 /* BlueTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlueTheme.h; sourceTree = ""; }; 197 | 104FB0181F55CC8700085793 /* BlueTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlueTheme.m; sourceTree = ""; }; 198 | 104FB01A1F55CDC200085793 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = ""; }; 199 | 104FB01B1F55CDC200085793 /* Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Module.m; sourceTree = ""; }; 200 | 104FB01F1F55CF1300085793 /* Theme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Theme.h; sourceTree = ""; }; 201 | 104FB0201F55CF1300085793 /* Theme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Theme.m; sourceTree = ""; }; 202 | 104FB0221F599A2F00085793 /* HouseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HouseManager.h; sourceTree = ""; }; 203 | 104FB0231F599A2F00085793 /* HouseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HouseManager.m; sourceTree = ""; }; 204 | 104FB0251F599A3900085793 /* Light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Light.h; sourceTree = ""; }; 205 | 104FB0261F599A3900085793 /* Light.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Light.m; sourceTree = ""; }; 206 | 104FB0281F599A6000085793 /* Curtain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Curtain.h; sourceTree = ""; }; 207 | 104FB0291F599A6000085793 /* Curtain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Curtain.m; sourceTree = ""; }; 208 | 107938991F3B7529000F287A /* MLDesignPatterns-OC */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "MLDesignPatterns-OC"; sourceTree = BUILT_PRODUCTS_DIR; }; 209 | 1079389C1F3B7529000F287A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 210 | 109400301F3CC4B70026A0BB /* Employee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Employee.h; sourceTree = ""; }; 211 | 109400311F3CC4B70026A0BB /* Employee.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Employee.m; sourceTree = ""; }; 212 | 109400331F3CC62E0026A0BB /* Company.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Company.h; sourceTree = ""; }; 213 | 109400341F3CC62E0026A0BB /* Company.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Company.m; sourceTree = ""; }; 214 | 109400361F41DF430026A0BB /* EmployeeDeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmployeeDeepCopy.h; sourceTree = ""; }; 215 | 109400371F41DF430026A0BB /* EmployeeDeepCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmployeeDeepCopy.m; sourceTree = ""; }; 216 | 109400391F41DF5A0026A0BB /* EmployeeShallowCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmployeeShallowCopy.h; sourceTree = ""; }; 217 | 1094003A1F41DF5A0026A0BB /* EmployeeShallowCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmployeeShallowCopy.m; sourceTree = ""; }; 218 | 109400461F42025E0026A0BB /* Singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Singleton.h; sourceTree = ""; }; 219 | 109400471F42025E0026A0BB /* Singleton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Singleton.m; sourceTree = ""; }; 220 | 10D3852C1F4497020095A417 /* Human.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Human.h; sourceTree = ""; }; 221 | 10D3852D1F4497020095A417 /* Human.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Human.m; sourceTree = ""; }; 222 | 10D3852F1F4497120095A417 /* BlackHuman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlackHuman.h; sourceTree = ""; }; 223 | 10D385301F4497120095A417 /* BlackHuman.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlackHuman.m; sourceTree = ""; }; 224 | 10D385311F4497120095A417 /* WhiteHuman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WhiteHuman.h; sourceTree = ""; }; 225 | 10D385321F4497120095A417 /* WhiteHuman.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WhiteHuman.m; sourceTree = ""; }; 226 | 10D385331F4497120095A417 /* YellowHuman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YellowHuman.h; sourceTree = ""; }; 227 | 10D385341F4497120095A417 /* YellowHuman.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YellowHuman.m; sourceTree = ""; }; 228 | 10D385381F44971B0095A417 /* NuWa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NuWa.h; sourceTree = ""; }; 229 | 10D385391F44971B0095A417 /* NuWa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NuWa.m; sourceTree = ""; }; 230 | 10D3853B1F4497260095A417 /* WhiteHumanFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WhiteHumanFactory.h; sourceTree = ""; }; 231 | 10D3853C1F4497260095A417 /* WhiteHumanFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WhiteHumanFactory.m; sourceTree = ""; }; 232 | 10D3853E1F4497C30095A417 /* YellowHumanFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YellowHumanFactory.h; sourceTree = ""; }; 233 | 10D3853F1F4497C30095A417 /* YellowHumanFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YellowHumanFactory.m; sourceTree = ""; }; 234 | 10D385411F4497E10095A417 /* HumanFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HumanFactory.h; sourceTree = ""; }; 235 | 10D385421F4499330095A417 /* BlackHumanFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlackHumanFactory.h; sourceTree = ""; }; 236 | 10D385431F4499330095A417 /* BlackHumanFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlackHumanFactory.m; sourceTree = ""; }; 237 | 10D385C71F4B2DD20095A417 /* WoodDoor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WoodDoor.h; sourceTree = ""; }; 238 | 10D385C81F4B2DD20095A417 /* WoodDoor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WoodDoor.m; sourceTree = ""; }; 239 | 10D385CA1F4B2DF80095A417 /* IronDoor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IronDoor.h; sourceTree = ""; }; 240 | 10D385CB1F4B2DF80095A417 /* IronDoor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IronDoor.m; sourceTree = ""; }; 241 | 10D385D11F4B2E890095A417 /* WoodDoorInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WoodDoorInstaller.h; sourceTree = ""; }; 242 | 10D385D21F4B2E890095A417 /* WoodDoorInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WoodDoorInstaller.m; sourceTree = ""; }; 243 | 10D385D41F4B2E950095A417 /* IronDoorInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IronDoorInstaller.h; sourceTree = ""; }; 244 | 10D385D51F4B2E950095A417 /* IronDoorInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IronDoorInstaller.m; sourceTree = ""; }; 245 | 10D385D91F4B324F0095A417 /* DoorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DoorFactory.h; sourceTree = ""; }; 246 | 10D385DA1F4B32870095A417 /* WoodDoorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WoodDoorFactory.h; sourceTree = ""; }; 247 | 10D385DB1F4B32870095A417 /* WoodDoorFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WoodDoorFactory.m; sourceTree = ""; }; 248 | 10D385DD1F4B32F70095A417 /* IronDoorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IronDoorFactory.h; sourceTree = ""; }; 249 | 10D385DE1F4B32F70095A417 /* IronDoorFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IronDoorFactory.m; sourceTree = ""; }; 250 | 10D385E01F4B34010095A417 /* Door.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Door.h; sourceTree = ""; }; 251 | 10D385E11F4B34010095A417 /* Door.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Door.m; sourceTree = ""; }; 252 | 10D385E31F4B343B0095A417 /* DoorInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DoorInstaller.h; sourceTree = ""; }; 253 | 10D385E41F4B343B0095A417 /* DoorInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DoorInstaller.m; sourceTree = ""; }; 254 | 10D385E61F4B3EA90095A417 /* HandWheatCake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandWheatCake.h; sourceTree = ""; }; 255 | 10D385E71F4B3EA90095A417 /* HandWheatCake.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HandWheatCake.m; sourceTree = ""; }; 256 | 10D385EC1F4B413F0095A417 /* HandWheatCakeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandWheatCakeBuilder.h; sourceTree = ""; }; 257 | 10D385ED1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FiveYuanNoSpicyBuild.h; sourceTree = ""; }; 258 | 10D385EE1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FiveYuanNoSpicyBuild.m; sourceTree = ""; }; 259 | 10D385F01F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TenYuanAbnormalSpicyBuild.h; sourceTree = ""; }; 260 | 10D385F11F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TenYuanAbnormalSpicyBuild.m; sourceTree = ""; }; 261 | 10D385F31F4B43A80095A417 /* Seller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Seller.h; sourceTree = ""; }; 262 | 10D385F41F4B43A80095A417 /* Seller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Seller.m; sourceTree = ""; }; 263 | 10F84C4C1F8D1B5300722C69 /* CommandProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommandProtocol.h; sourceTree = ""; }; 264 | 10F84C4D1F8D1E5F00722C69 /* Waiter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Waiter.h; sourceTree = ""; }; 265 | 10F84C4E1F8D1E5F00722C69 /* Waiter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Waiter.m; sourceTree = ""; }; 266 | 10FDC3FF1F9527D00083B82A /* Publish.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Publish.h; sourceTree = ""; }; 267 | 10FDC4001F9527D00083B82A /* Publish.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Publish.m; sourceTree = ""; }; 268 | 10FDC4021F9528400083B82A /* PublishProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PublishProtocol.h; sourceTree = ""; }; 269 | 10FDC4031F9529500083B82A /* AndroidPublish.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AndroidPublish.h; sourceTree = ""; }; 270 | 10FDC4041F9529500083B82A /* AndroidPublish.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AndroidPublish.m; sourceTree = ""; }; 271 | 10FDC4061F95295A0083B82A /* iOSPublish.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iOSPublish.h; sourceTree = ""; }; 272 | 10FDC4071F95295A0083B82A /* iOSPublish.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iOSPublish.m; sourceTree = ""; }; 273 | 2473BFF61F590FB40018E4A3 /* FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystem.h; sourceTree = ""; }; 274 | 2473BFF71F59108D0018E4A3 /* Folder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Folder.h; sourceTree = ""; }; 275 | 2473BFF81F59108D0018E4A3 /* Folder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Folder.m; sourceTree = ""; }; 276 | 2473BFFD1F592A120018E4A3 /* HeaderFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderFile.h; sourceTree = ""; }; 277 | 2473BFFE1F592A120018E4A3 /* HeaderFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HeaderFile.m; sourceTree = ""; }; 278 | 2473C0021F592A910018E4A3 /* ImplementationFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImplementationFile.h; sourceTree = ""; }; 279 | 2473C0031F592A910018E4A3 /* ImplementationFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImplementationFile.m; sourceTree = ""; }; 280 | 2473C0051F592BB20018E4A3 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = ""; }; 281 | 2473C0061F592BB20018E4A3 /* File.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = File.m; sourceTree = ""; }; 282 | /* End PBXFileReference section */ 283 | 284 | /* Begin PBXFrameworksBuildPhase section */ 285 | 107938961F3B7529000F287A /* Frameworks */ = { 286 | isa = PBXFrameworksBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXFrameworksBuildPhase section */ 293 | 294 | /* Begin PBXGroup section */ 295 | 107938901F3B7529000F287A = { 296 | isa = PBXGroup; 297 | children = ( 298 | 1079389B1F3B7529000F287A /* MLDesignPatterns-OC */, 299 | 1079389A1F3B7529000F287A /* Products */, 300 | ); 301 | sourceTree = ""; 302 | }; 303 | 1079389A1F3B7529000F287A /* Products */ = { 304 | isa = PBXGroup; 305 | children = ( 306 | 107938991F3B7529000F287A /* MLDesignPatterns-OC */, 307 | ); 308 | name = Products; 309 | sourceTree = ""; 310 | }; 311 | 1079389B1F3B7529000F287A /* MLDesignPatterns-OC */ = { 312 | isa = PBXGroup; 313 | children = ( 314 | 107938A31F3B761F000F287A /* AbstractFactory */, 315 | 107938A41F3B761F000F287A /* Adapter */, 316 | 107938A61F3B761F000F287A /* Bridge */, 317 | 107938A71F3B761F000F287A /* Builder */, 318 | 107938A81F3B761F000F287A /* ChainOfResponsibility */, 319 | 107938A91F3B761F000F287A /* Command */, 320 | 107938AA1F3B761F000F287A /* Composite */, 321 | 107938AB1F3B761F000F287A /* Decorator */, 322 | 107938AC1F3B761F000F287A /* Facade */, 323 | 107938AD1F3B761F000F287A /* FactoryMethod */, 324 | 107938AE1F3B761F000F287A /* Flyweight */, 325 | 107938AF1F3B761F000F287A /* Interpreter */, 326 | 107938B01F3B761F000F287A /* Iterator */, 327 | 107938B11F3B761F000F287A /* Mediator */, 328 | 107938B21F3B761F000F287A /* Memento */, 329 | 107938B31F3B761F000F287A /* Observer */, 330 | 107938B41F3B761F000F287A /* Prototype */, 331 | 107938B51F3B761F000F287A /* Proxy */, 332 | 107938B61F3B761F000F287A /* Singleton */, 333 | 107938B71F3B761F000F287A /* State */, 334 | 107938B81F3B761F000F287A /* Strategy */, 335 | 107938B91F3B761F000F287A /* TemplateMethod */, 336 | 107938BA1F3B761F000F287A /* Visitor */, 337 | 1079389C1F3B7529000F287A /* main.m */, 338 | ); 339 | path = "MLDesignPatterns-OC"; 340 | sourceTree = ""; 341 | }; 342 | 107938A31F3B761F000F287A /* AbstractFactory */ = { 343 | isa = PBXGroup; 344 | children = ( 345 | 10D385E01F4B34010095A417 /* Door.h */, 346 | 10D385E11F4B34010095A417 /* Door.m */, 347 | 10D385C71F4B2DD20095A417 /* WoodDoor.h */, 348 | 10D385C81F4B2DD20095A417 /* WoodDoor.m */, 349 | 10D385CA1F4B2DF80095A417 /* IronDoor.h */, 350 | 10D385CB1F4B2DF80095A417 /* IronDoor.m */, 351 | 10D385E31F4B343B0095A417 /* DoorInstaller.h */, 352 | 10D385E41F4B343B0095A417 /* DoorInstaller.m */, 353 | 10D385D11F4B2E890095A417 /* WoodDoorInstaller.h */, 354 | 10D385D21F4B2E890095A417 /* WoodDoorInstaller.m */, 355 | 10D385D41F4B2E950095A417 /* IronDoorInstaller.h */, 356 | 10D385D51F4B2E950095A417 /* IronDoorInstaller.m */, 357 | 10D385D91F4B324F0095A417 /* DoorFactory.h */, 358 | 10D385DA1F4B32870095A417 /* WoodDoorFactory.h */, 359 | 10D385DB1F4B32870095A417 /* WoodDoorFactory.m */, 360 | 10D385DD1F4B32F70095A417 /* IronDoorFactory.h */, 361 | 10D385DE1F4B32F70095A417 /* IronDoorFactory.m */, 362 | ); 363 | path = AbstractFactory; 364 | sourceTree = ""; 365 | }; 366 | 107938A41F3B761F000F287A /* Adapter */ = { 367 | isa = PBXGroup; 368 | children = ( 369 | 104FAFFF1F55BE1A00085793 /* SpeakEnglish.h */, 370 | 104FB0001F55BE1A00085793 /* SpeakEnglish.m */, 371 | 104FB0021F55BE2400085793 /* SpeakChinese.h */, 372 | 104FB0031F55BE2400085793 /* SpeakChinese.m */, 373 | 104FB0051F55BEC600085793 /* InternationalConference.h */, 374 | 104FB0061F55C07C00085793 /* Translator.h */, 375 | 104FB0071F55C07C00085793 /* Translator.m */, 376 | ); 377 | path = Adapter; 378 | sourceTree = ""; 379 | }; 380 | 107938A61F3B761F000F287A /* Bridge */ = { 381 | isa = PBXGroup; 382 | children = ( 383 | 104FB00C1F55CB3800085793 /* App.h */, 384 | 104FB01A1F55CDC200085793 /* Module.h */, 385 | 104FB01B1F55CDC200085793 /* Module.m */, 386 | 104FB00D1F55CBB800085793 /* MyModule.h */, 387 | 104FB00E1F55CBB800085793 /* MyModule.m */, 388 | 104FB0101F55CBEB00085793 /* ChatModule.h */, 389 | 104FB0111F55CBEB00085793 /* ChatModule.m */, 390 | 104FB0131F55CC6B00085793 /* ThemeInfo.h */, 391 | 104FB01F1F55CF1300085793 /* Theme.h */, 392 | 104FB0201F55CF1300085793 /* Theme.m */, 393 | 104FB0141F55CC7800085793 /* RedTheme.h */, 394 | 104FB0151F55CC7800085793 /* RedTheme.m */, 395 | 104FB0171F55CC8700085793 /* BlueTheme.h */, 396 | 104FB0181F55CC8700085793 /* BlueTheme.m */, 397 | ); 398 | path = Bridge; 399 | sourceTree = ""; 400 | }; 401 | 107938A71F3B761F000F287A /* Builder */ = { 402 | isa = PBXGroup; 403 | children = ( 404 | 10D385E61F4B3EA90095A417 /* HandWheatCake.h */, 405 | 10D385E71F4B3EA90095A417 /* HandWheatCake.m */, 406 | 10D385EC1F4B413F0095A417 /* HandWheatCakeBuilder.h */, 407 | 10D385ED1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.h */, 408 | 10D385EE1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.m */, 409 | 10D385F01F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.h */, 410 | 10D385F11F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.m */, 411 | 10D385F31F4B43A80095A417 /* Seller.h */, 412 | 10D385F41F4B43A80095A417 /* Seller.m */, 413 | ); 414 | path = Builder; 415 | sourceTree = ""; 416 | }; 417 | 107938A81F3B761F000F287A /* ChainOfResponsibility */ = { 418 | isa = PBXGroup; 419 | children = ( 420 | 104D30FE1F619CC90092D139 /* Leave.h */, 421 | 104D31021F619F8B0092D139 /* Manager.h */, 422 | 104D31031F619F8B0092D139 /* Manager.m */, 423 | 104D31051F619F9D0092D139 /* CEO.h */, 424 | 104D31061F619F9D0092D139 /* CEO.m */, 425 | 104D31081F61A0FC0092D139 /* CTO.h */, 426 | 104D31091F61A0FC0092D139 /* CTO.m */, 427 | 104D310B1F61A27B0092D139 /* PM.h */, 428 | 104D310C1F61A27B0092D139 /* PM.m */, 429 | ); 430 | path = ChainOfResponsibility; 431 | sourceTree = ""; 432 | }; 433 | 107938A91F3B761F000F287A /* Command */ = { 434 | isa = PBXGroup; 435 | children = ( 436 | 10F84C4C1F8D1B5300722C69 /* CommandProtocol.h */, 437 | 10F84C4D1F8D1E5F00722C69 /* Waiter.h */, 438 | 10F84C4E1F8D1E5F00722C69 /* Waiter.m */, 439 | 10428FE81F8D21CB00C67F26 /* Cook.h */, 440 | 10428FE91F8D21CB00C67F26 /* Cook.m */, 441 | 10428FF11F8D22E800C67F26 /* Command.h */, 442 | 10428FF21F8D22E800C67F26 /* Command.m */, 443 | 10428FEB1F8D224100C67F26 /* LobsterCommand.h */, 444 | 10428FEC1F8D224100C67F26 /* LobsterCommand.m */, 445 | 10428FEE1F8D225A00C67F26 /* AbaloneCommand.h */, 446 | 10428FEF1F8D225A00C67F26 /* AbaloneCommand.m */, 447 | ); 448 | path = Command; 449 | sourceTree = ""; 450 | }; 451 | 107938AA1F3B761F000F287A /* Composite */ = { 452 | isa = PBXGroup; 453 | children = ( 454 | 2473BFF61F590FB40018E4A3 /* FileSystem.h */, 455 | 2473BFF71F59108D0018E4A3 /* Folder.h */, 456 | 2473BFF81F59108D0018E4A3 /* Folder.m */, 457 | 2473C0051F592BB20018E4A3 /* File.h */, 458 | 2473C0061F592BB20018E4A3 /* File.m */, 459 | 2473BFFD1F592A120018E4A3 /* HeaderFile.h */, 460 | 2473BFFE1F592A120018E4A3 /* HeaderFile.m */, 461 | 2473C0021F592A910018E4A3 /* ImplementationFile.h */, 462 | 2473C0031F592A910018E4A3 /* ImplementationFile.m */, 463 | ); 464 | path = Composite; 465 | sourceTree = ""; 466 | }; 467 | 107938AB1F3B761F000F287A /* Decorator */ = { 468 | isa = PBXGroup; 469 | children = ( 470 | 104D30E31F5C5C740092D139 /* Humburger.h */, 471 | 104D30E41F5C5CC30092D139 /* ChickenBurger.h */, 472 | 104D30E51F5C5CC30092D139 /* ChickenBurger.m */, 473 | 104D30E71F5C5DA60092D139 /* Condiment.h */, 474 | 104D30E81F5C5DA60092D139 /* Condiment.m */, 475 | 104D30EA1F5C5E290092D139 /* Chilli.h */, 476 | 104D30EB1F5C5E290092D139 /* Chilli.m */, 477 | 104D30ED1F5C5FB00092D139 /* Egg.h */, 478 | 104D30EE1F5C5FB00092D139 /* Egg.m */, 479 | ); 480 | path = Decorator; 481 | sourceTree = ""; 482 | }; 483 | 107938AC1F3B761F000F287A /* Facade */ = { 484 | isa = PBXGroup; 485 | children = ( 486 | 104FB0221F599A2F00085793 /* HouseManager.h */, 487 | 104FB0231F599A2F00085793 /* HouseManager.m */, 488 | 104FB0251F599A3900085793 /* Light.h */, 489 | 104FB0261F599A3900085793 /* Light.m */, 490 | 104FB0281F599A6000085793 /* Curtain.h */, 491 | 104FB0291F599A6000085793 /* Curtain.m */, 492 | ); 493 | path = Facade; 494 | sourceTree = ""; 495 | }; 496 | 107938AD1F3B761F000F287A /* FactoryMethod */ = { 497 | isa = PBXGroup; 498 | children = ( 499 | 10D385381F44971B0095A417 /* NuWa.h */, 500 | 10D385391F44971B0095A417 /* NuWa.m */, 501 | 10D3852C1F4497020095A417 /* Human.h */, 502 | 10D3852D1F4497020095A417 /* Human.m */, 503 | 10D385411F4497E10095A417 /* HumanFactory.h */, 504 | 10D385311F4497120095A417 /* WhiteHuman.h */, 505 | 10D385321F4497120095A417 /* WhiteHuman.m */, 506 | 10D3853B1F4497260095A417 /* WhiteHumanFactory.h */, 507 | 10D3853C1F4497260095A417 /* WhiteHumanFactory.m */, 508 | 10D385331F4497120095A417 /* YellowHuman.h */, 509 | 10D385341F4497120095A417 /* YellowHuman.m */, 510 | 10D3853E1F4497C30095A417 /* YellowHumanFactory.h */, 511 | 10D3853F1F4497C30095A417 /* YellowHumanFactory.m */, 512 | 10D3852F1F4497120095A417 /* BlackHuman.h */, 513 | 10D385301F4497120095A417 /* BlackHuman.m */, 514 | 10D385421F4499330095A417 /* BlackHumanFactory.h */, 515 | 10D385431F4499330095A417 /* BlackHumanFactory.m */, 516 | ); 517 | path = FactoryMethod; 518 | sourceTree = ""; 519 | }; 520 | 107938AE1F3B761F000F287A /* Flyweight */ = { 521 | isa = PBXGroup; 522 | children = ( 523 | 104D30F01F5DB0CE0092D139 /* Shape.h */, 524 | 104D30F11F5DB1010092D139 /* Circle.h */, 525 | 104D30F21F5DB1010092D139 /* Circle.m */, 526 | 104D30F41F5DB19F0092D139 /* FlyweightFactory.h */, 527 | 104D30F51F5DB19F0092D139 /* FlyweightFactory.m */, 528 | ); 529 | path = Flyweight; 530 | sourceTree = ""; 531 | }; 532 | 107938AF1F3B761F000F287A /* Interpreter */ = { 533 | isa = PBXGroup; 534 | children = ( 535 | ); 536 | path = Interpreter; 537 | sourceTree = ""; 538 | }; 539 | 107938B01F3B761F000F287A /* Iterator */ = { 540 | isa = PBXGroup; 541 | children = ( 542 | ); 543 | path = Iterator; 544 | sourceTree = ""; 545 | }; 546 | 107938B11F3B761F000F287A /* Mediator */ = { 547 | isa = PBXGroup; 548 | children = ( 549 | 10428FF41F8FC25200C67F26 /* MediatorProtocol.h */, 550 | 10428FF51F8FC3AD00C67F26 /* ChatRoom.h */, 551 | 10428FF61F8FC3AD00C67F26 /* ChatRoom.m */, 552 | 10428FF81F8FC4A600C67F26 /* User.h */, 553 | 10428FF91F8FC4A600C67F26 /* User.m */, 554 | ); 555 | path = Mediator; 556 | sourceTree = ""; 557 | }; 558 | 107938B21F3B761F000F287A /* Memento */ = { 559 | isa = PBXGroup; 560 | children = ( 561 | 104290061F94FE2300C67F26 /* EditorMemento.h */, 562 | 104290071F94FE2300C67F26 /* EditorMemento.m */, 563 | 104290091F94FEA800C67F26 /* Editor.h */, 564 | 1042900A1F94FEA800C67F26 /* Editor.m */, 565 | ); 566 | path = Memento; 567 | sourceTree = ""; 568 | }; 569 | 107938B31F3B761F000F287A /* Observer */ = { 570 | isa = PBXGroup; 571 | children = ( 572 | 104290021F8FCF3D00C67F26 /* SubjectProtocol.h */, 573 | 10428FFB1F8FCB4300C67F26 /* JobProvider.h */, 574 | 10428FFC1F8FCB4300C67F26 /* JobProvider.m */, 575 | 10428FFE1F8FCD5B00C67F26 /* ObserverProtocol.h */, 576 | 104290031F8FD05700C67F26 /* JobHunter.h */, 577 | 104290041F8FD05700C67F26 /* JobHunter.m */, 578 | ); 579 | path = Observer; 580 | sourceTree = ""; 581 | }; 582 | 107938B41F3B761F000F287A /* Prototype */ = { 583 | isa = PBXGroup; 584 | children = ( 585 | 109400301F3CC4B70026A0BB /* Employee.h */, 586 | 109400311F3CC4B70026A0BB /* Employee.m */, 587 | 109400331F3CC62E0026A0BB /* Company.h */, 588 | 109400341F3CC62E0026A0BB /* Company.m */, 589 | 109400361F41DF430026A0BB /* EmployeeDeepCopy.h */, 590 | 109400371F41DF430026A0BB /* EmployeeDeepCopy.m */, 591 | 109400391F41DF5A0026A0BB /* EmployeeShallowCopy.h */, 592 | 1094003A1F41DF5A0026A0BB /* EmployeeShallowCopy.m */, 593 | ); 594 | path = Prototype; 595 | sourceTree = ""; 596 | }; 597 | 107938B51F3B761F000F287A /* Proxy */ = { 598 | isa = PBXGroup; 599 | children = ( 600 | 104D30F71F5DBA770092D139 /* Ticket.h */, 601 | 104D30F81F5DBAB70092D139 /* TrainStation.h */, 602 | 104D30F91F5DBAB70092D139 /* TrainStation.m */, 603 | 104D30FB1F5DBAF90092D139 /* TicketOutlets.h */, 604 | 104D30FC1F5DBAF90092D139 /* TicketOutlets.m */, 605 | ); 606 | path = Proxy; 607 | sourceTree = ""; 608 | }; 609 | 107938B61F3B761F000F287A /* Singleton */ = { 610 | isa = PBXGroup; 611 | children = ( 612 | 109400461F42025E0026A0BB /* Singleton.h */, 613 | 109400471F42025E0026A0BB /* Singleton.m */, 614 | ); 615 | path = Singleton; 616 | sourceTree = ""; 617 | }; 618 | 107938B71F3B761F000F287A /* State */ = { 619 | isa = PBXGroup; 620 | children = ( 621 | 101484F31F965D9800D41236 /* DrawProtocol.h */, 622 | 101484F41F965E6E00D41236 /* BallPen.h */, 623 | 101484F51F965E6E00D41236 /* BallPen.m */, 624 | 101484F71F965EA800D41236 /* Pen.h */, 625 | 101484F81F965EA800D41236 /* Pen.m */, 626 | 101484FA1F965EBF00D41236 /* WritingBrush.h */, 627 | 101484FB1F965EBF00D41236 /* WritingBrush.m */, 628 | 101484FD1F965F4800D41236 /* TextEditor.h */, 629 | 101484FE1F965F4800D41236 /* TextEditor.m */, 630 | ); 631 | path = State; 632 | sourceTree = ""; 633 | }; 634 | 107938B81F3B761F000F287A /* Strategy */ = { 635 | isa = PBXGroup; 636 | children = ( 637 | 1042900C1F95091400C67F26 /* StrategyProtocol.h */, 638 | 1042900D1F95096B00C67F26 /* BubbleSortStrategy.h */, 639 | 1042900E1F95096B00C67F26 /* BubbleSortStrategy.m */, 640 | 104290101F95097700C67F26 /* QuickSortStrategy.h */, 641 | 104290111F95097700C67F26 /* QuickSortStrategy.m */, 642 | 104290131F950D1900C67F26 /* Sort.h */, 643 | 104290141F950D1900C67F26 /* Sort.m */, 644 | ); 645 | path = Strategy; 646 | sourceTree = ""; 647 | }; 648 | 107938B91F3B761F000F287A /* TemplateMethod */ = { 649 | isa = PBXGroup; 650 | children = ( 651 | 10FDC4021F9528400083B82A /* PublishProtocol.h */, 652 | 10FDC3FF1F9527D00083B82A /* Publish.h */, 653 | 10FDC4001F9527D00083B82A /* Publish.m */, 654 | 10FDC4061F95295A0083B82A /* iOSPublish.h */, 655 | 10FDC4071F95295A0083B82A /* iOSPublish.m */, 656 | 10FDC4031F9529500083B82A /* AndroidPublish.h */, 657 | 10FDC4041F9529500083B82A /* AndroidPublish.m */, 658 | ); 659 | path = TemplateMethod; 660 | sourceTree = ""; 661 | }; 662 | 107938BA1F3B761F000F287A /* Visitor */ = { 663 | isa = PBXGroup; 664 | children = ( 665 | 104290161F951CB300C67F26 /* PersonProtocol.h */, 666 | 104290181F951D2100C67F26 /* PositivePerson.h */, 667 | 104290191F951D2100C67F26 /* PositivePerson.m */, 668 | 1042901B1F951D3C00C67F26 /* NegativePerson.h */, 669 | 1042901C1F951D3C00C67F26 /* NegativePerson.m */, 670 | 104290171F951CCC00C67F26 /* ActionProtocol.h */, 671 | 104964981F9522B500651EE2 /* HalfCupWater.h */, 672 | 104964991F9522B500651EE2 /* HalfCupWater.m */, 673 | 1049649B1F95234B00651EE2 /* ObjectStructure.h */, 674 | 1049649C1F95234B00651EE2 /* ObjectStructure.m */, 675 | ); 676 | path = Visitor; 677 | sourceTree = ""; 678 | }; 679 | /* End PBXGroup section */ 680 | 681 | /* Begin PBXNativeTarget section */ 682 | 107938981F3B7529000F287A /* MLDesignPatterns-OC */ = { 683 | isa = PBXNativeTarget; 684 | buildConfigurationList = 107938A01F3B7529000F287A /* Build configuration list for PBXNativeTarget "MLDesignPatterns-OC" */; 685 | buildPhases = ( 686 | 107938951F3B7529000F287A /* Sources */, 687 | 107938961F3B7529000F287A /* Frameworks */, 688 | 107938971F3B7529000F287A /* CopyFiles */, 689 | ); 690 | buildRules = ( 691 | ); 692 | dependencies = ( 693 | ); 694 | name = "MLDesignPatterns-OC"; 695 | productName = "MLDesignPatterns-OC"; 696 | productReference = 107938991F3B7529000F287A /* MLDesignPatterns-OC */; 697 | productType = "com.apple.product-type.tool"; 698 | }; 699 | /* End PBXNativeTarget section */ 700 | 701 | /* Begin PBXProject section */ 702 | 107938911F3B7529000F287A /* Project object */ = { 703 | isa = PBXProject; 704 | attributes = { 705 | LastUpgradeCheck = 0830; 706 | ORGANIZATIONNAME = mali; 707 | TargetAttributes = { 708 | 107938981F3B7529000F287A = { 709 | CreatedOnToolsVersion = 8.3.3; 710 | ProvisioningStyle = Automatic; 711 | }; 712 | }; 713 | }; 714 | buildConfigurationList = 107938941F3B7529000F287A /* Build configuration list for PBXProject "MLDesignPatterns-OC" */; 715 | compatibilityVersion = "Xcode 3.2"; 716 | developmentRegion = English; 717 | hasScannedForEncodings = 0; 718 | knownRegions = ( 719 | en, 720 | ); 721 | mainGroup = 107938901F3B7529000F287A; 722 | productRefGroup = 1079389A1F3B7529000F287A /* Products */; 723 | projectDirPath = ""; 724 | projectRoot = ""; 725 | targets = ( 726 | 107938981F3B7529000F287A /* MLDesignPatterns-OC */, 727 | ); 728 | }; 729 | /* End PBXProject section */ 730 | 731 | /* Begin PBXSourcesBuildPhase section */ 732 | 107938951F3B7529000F287A /* Sources */ = { 733 | isa = PBXSourcesBuildPhase; 734 | buildActionMask = 2147483647; 735 | files = ( 736 | 10D385E81F4B3EA90095A417 /* HandWheatCake.m in Sources */, 737 | 104290151F950D1900C67F26 /* Sort.m in Sources */, 738 | 10FDC4081F95295A0083B82A /* iOSPublish.m in Sources */, 739 | 10D385DF1F4B32F70095A417 /* IronDoorFactory.m in Sources */, 740 | 10D385F51F4B43A80095A417 /* Seller.m in Sources */, 741 | 10D385F21F4B42BD0095A417 /* TenYuanAbnormalSpicyBuild.m in Sources */, 742 | 104FB0041F55BE2400085793 /* SpeakChinese.m in Sources */, 743 | 104FB0191F55CC8700085793 /* BlueTheme.m in Sources */, 744 | 10D3852E1F4497020095A417 /* Human.m in Sources */, 745 | 2473BFF91F59108D0018E4A3 /* Folder.m in Sources */, 746 | 10D385CC1F4B2DF80095A417 /* IronDoor.m in Sources */, 747 | 10F84C4F1F8D1E5F00722C69 /* Waiter.m in Sources */, 748 | 1079389D1F3B7529000F287A /* main.m in Sources */, 749 | 10428FED1F8D224100C67F26 /* LobsterCommand.m in Sources */, 750 | 1042900F1F95096B00C67F26 /* BubbleSortStrategy.m in Sources */, 751 | 104FB01C1F55CDC200085793 /* Module.m in Sources */, 752 | 109400351F3CC62E0026A0BB /* Company.m in Sources */, 753 | 10D385D61F4B2E950095A417 /* IronDoorInstaller.m in Sources */, 754 | 104FB0011F55BE1A00085793 /* SpeakEnglish.m in Sources */, 755 | 104FB0271F599A3900085793 /* Light.m in Sources */, 756 | 104FB0081F55C07C00085793 /* Translator.m in Sources */, 757 | 104FB02A1F599A6000085793 /* Curtain.m in Sources */, 758 | 104D30EF1F5C5FB00092D139 /* Egg.m in Sources */, 759 | 101484FC1F965EBF00D41236 /* WritingBrush.m in Sources */, 760 | 109400381F41DF430026A0BB /* EmployeeDeepCopy.m in Sources */, 761 | 104D30FA1F5DBAB70092D139 /* TrainStation.m in Sources */, 762 | 104FB0241F599A2F00085793 /* HouseManager.m in Sources */, 763 | 104D30E91F5C5DA60092D139 /* Condiment.m in Sources */, 764 | 10428FF01F8D225A00C67F26 /* AbaloneCommand.m in Sources */, 765 | 10D385441F4499330095A417 /* BlackHumanFactory.m in Sources */, 766 | 104D31071F619F9D0092D139 /* CEO.m in Sources */, 767 | 104D310A1F61A0FC0092D139 /* CTO.m in Sources */, 768 | 10D385E51F4B343B0095A417 /* DoorInstaller.m in Sources */, 769 | 109400481F42025E0026A0BB /* Singleton.m in Sources */, 770 | 104D30F61F5DB19F0092D139 /* FlyweightFactory.m in Sources */, 771 | 104D31041F619F8B0092D139 /* Manager.m in Sources */, 772 | 1042901D1F951D3C00C67F26 /* NegativePerson.m in Sources */, 773 | 10428FFD1F8FCB4300C67F26 /* JobProvider.m in Sources */, 774 | 10D385371F4497120095A417 /* YellowHuman.m in Sources */, 775 | 101484F61F965E6E00D41236 /* BallPen.m in Sources */, 776 | 104D30F31F5DB1010092D139 /* Circle.m in Sources */, 777 | 10FDC4011F9527D00083B82A /* Publish.m in Sources */, 778 | 101484FF1F965F4800D41236 /* TextEditor.m in Sources */, 779 | 104290121F95097700C67F26 /* QuickSortStrategy.m in Sources */, 780 | 10428FF31F8D22E800C67F26 /* Command.m in Sources */, 781 | 10D385351F4497120095A417 /* BlackHuman.m in Sources */, 782 | 1042901A1F951D2100C67F26 /* PositivePerson.m in Sources */, 783 | 10D385D31F4B2E890095A417 /* WoodDoorInstaller.m in Sources */, 784 | 104290081F94FE2300C67F26 /* EditorMemento.m in Sources */, 785 | 104FB0161F55CC7800085793 /* RedTheme.m in Sources */, 786 | 104FB00F1F55CBB800085793 /* MyModule.m in Sources */, 787 | 10D385C91F4B2DD20095A417 /* WoodDoor.m in Sources */, 788 | 10D385401F4497C30095A417 /* YellowHumanFactory.m in Sources */, 789 | 104D30FD1F5DBAF90092D139 /* TicketOutlets.m in Sources */, 790 | 10428FFA1F8FC4A600C67F26 /* User.m in Sources */, 791 | 2473C0071F592BB20018E4A3 /* File.m in Sources */, 792 | 109400321F3CC4B70026A0BB /* Employee.m in Sources */, 793 | 101484F91F965EA800D41236 /* Pen.m in Sources */, 794 | 2473C0041F592A910018E4A3 /* ImplementationFile.m in Sources */, 795 | 1049649A1F9522B500651EE2 /* HalfCupWater.m in Sources */, 796 | 104FB0121F55CBEB00085793 /* ChatModule.m in Sources */, 797 | 2473BFFF1F592A120018E4A3 /* HeaderFile.m in Sources */, 798 | 10D3853D1F4497260095A417 /* WhiteHumanFactory.m in Sources */, 799 | 104FB0211F55CF1300085793 /* Theme.m in Sources */, 800 | 104D30E61F5C5CC30092D139 /* ChickenBurger.m in Sources */, 801 | 1094003B1F41DF5A0026A0BB /* EmployeeShallowCopy.m in Sources */, 802 | 10D385E21F4B34010095A417 /* Door.m in Sources */, 803 | 104D310D1F61A27B0092D139 /* PM.m in Sources */, 804 | 10D3853A1F44971B0095A417 /* NuWa.m in Sources */, 805 | 10D385EF1F4B41BF0095A417 /* FiveYuanNoSpicyBuild.m in Sources */, 806 | 10D385361F4497120095A417 /* WhiteHuman.m in Sources */, 807 | 10428FEA1F8D21CB00C67F26 /* Cook.m in Sources */, 808 | 104290051F8FD05700C67F26 /* JobHunter.m in Sources */, 809 | 10D385DC1F4B32870095A417 /* WoodDoorFactory.m in Sources */, 810 | 1049649D1F95234B00651EE2 /* ObjectStructure.m in Sources */, 811 | 10428FF71F8FC3AD00C67F26 /* ChatRoom.m in Sources */, 812 | 10FDC4051F9529500083B82A /* AndroidPublish.m in Sources */, 813 | 104D30EC1F5C5E290092D139 /* Chilli.m in Sources */, 814 | 1042900B1F94FEA800C67F26 /* Editor.m in Sources */, 815 | ); 816 | runOnlyForDeploymentPostprocessing = 0; 817 | }; 818 | /* End PBXSourcesBuildPhase section */ 819 | 820 | /* Begin XCBuildConfiguration section */ 821 | 1079389E1F3B7529000F287A /* Debug */ = { 822 | isa = XCBuildConfiguration; 823 | buildSettings = { 824 | ALWAYS_SEARCH_USER_PATHS = NO; 825 | CLANG_ANALYZER_NONNULL = YES; 826 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 827 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 828 | CLANG_CXX_LIBRARY = "libc++"; 829 | CLANG_ENABLE_MODULES = YES; 830 | CLANG_ENABLE_OBJC_ARC = YES; 831 | CLANG_WARN_BOOL_CONVERSION = YES; 832 | CLANG_WARN_CONSTANT_CONVERSION = YES; 833 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 834 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 835 | CLANG_WARN_EMPTY_BODY = YES; 836 | CLANG_WARN_ENUM_CONVERSION = YES; 837 | CLANG_WARN_INFINITE_RECURSION = YES; 838 | CLANG_WARN_INT_CONVERSION = YES; 839 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 840 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 841 | CLANG_WARN_UNREACHABLE_CODE = YES; 842 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 843 | CODE_SIGN_IDENTITY = "-"; 844 | COPY_PHASE_STRIP = NO; 845 | DEBUG_INFORMATION_FORMAT = dwarf; 846 | ENABLE_STRICT_OBJC_MSGSEND = YES; 847 | ENABLE_TESTABILITY = YES; 848 | GCC_C_LANGUAGE_STANDARD = gnu99; 849 | GCC_DYNAMIC_NO_PIC = NO; 850 | GCC_NO_COMMON_BLOCKS = YES; 851 | GCC_OPTIMIZATION_LEVEL = 0; 852 | GCC_PREPROCESSOR_DEFINITIONS = ( 853 | "DEBUG=1", 854 | "$(inherited)", 855 | ); 856 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 857 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 858 | GCC_WARN_UNDECLARED_SELECTOR = YES; 859 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 860 | GCC_WARN_UNUSED_FUNCTION = YES; 861 | GCC_WARN_UNUSED_VARIABLE = YES; 862 | MACOSX_DEPLOYMENT_TARGET = 10.12; 863 | MTL_ENABLE_DEBUG_INFO = YES; 864 | ONLY_ACTIVE_ARCH = YES; 865 | SDKROOT = macosx; 866 | }; 867 | name = Debug; 868 | }; 869 | 1079389F1F3B7529000F287A /* Release */ = { 870 | isa = XCBuildConfiguration; 871 | buildSettings = { 872 | ALWAYS_SEARCH_USER_PATHS = NO; 873 | CLANG_ANALYZER_NONNULL = YES; 874 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 875 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 876 | CLANG_CXX_LIBRARY = "libc++"; 877 | CLANG_ENABLE_MODULES = YES; 878 | CLANG_ENABLE_OBJC_ARC = YES; 879 | CLANG_WARN_BOOL_CONVERSION = YES; 880 | CLANG_WARN_CONSTANT_CONVERSION = YES; 881 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 882 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 883 | CLANG_WARN_EMPTY_BODY = YES; 884 | CLANG_WARN_ENUM_CONVERSION = YES; 885 | CLANG_WARN_INFINITE_RECURSION = YES; 886 | CLANG_WARN_INT_CONVERSION = YES; 887 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 888 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 889 | CLANG_WARN_UNREACHABLE_CODE = YES; 890 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 891 | CODE_SIGN_IDENTITY = "-"; 892 | COPY_PHASE_STRIP = NO; 893 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 894 | ENABLE_NS_ASSERTIONS = NO; 895 | ENABLE_STRICT_OBJC_MSGSEND = YES; 896 | GCC_C_LANGUAGE_STANDARD = gnu99; 897 | GCC_NO_COMMON_BLOCKS = YES; 898 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 899 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 900 | GCC_WARN_UNDECLARED_SELECTOR = YES; 901 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 902 | GCC_WARN_UNUSED_FUNCTION = YES; 903 | GCC_WARN_UNUSED_VARIABLE = YES; 904 | MACOSX_DEPLOYMENT_TARGET = 10.12; 905 | MTL_ENABLE_DEBUG_INFO = NO; 906 | SDKROOT = macosx; 907 | }; 908 | name = Release; 909 | }; 910 | 107938A11F3B7529000F287A /* Debug */ = { 911 | isa = XCBuildConfiguration; 912 | buildSettings = { 913 | PRODUCT_NAME = "$(TARGET_NAME)"; 914 | }; 915 | name = Debug; 916 | }; 917 | 107938A21F3B7529000F287A /* Release */ = { 918 | isa = XCBuildConfiguration; 919 | buildSettings = { 920 | PRODUCT_NAME = "$(TARGET_NAME)"; 921 | }; 922 | name = Release; 923 | }; 924 | /* End XCBuildConfiguration section */ 925 | 926 | /* Begin XCConfigurationList section */ 927 | 107938941F3B7529000F287A /* Build configuration list for PBXProject "MLDesignPatterns-OC" */ = { 928 | isa = XCConfigurationList; 929 | buildConfigurations = ( 930 | 1079389E1F3B7529000F287A /* Debug */, 931 | 1079389F1F3B7529000F287A /* Release */, 932 | ); 933 | defaultConfigurationIsVisible = 0; 934 | defaultConfigurationName = Release; 935 | }; 936 | 107938A01F3B7529000F287A /* Build configuration list for PBXNativeTarget "MLDesignPatterns-OC" */ = { 937 | isa = XCConfigurationList; 938 | buildConfigurations = ( 939 | 107938A11F3B7529000F287A /* Debug */, 940 | 107938A21F3B7529000F287A /* Release */, 941 | ); 942 | defaultConfigurationIsVisible = 0; 943 | defaultConfigurationName = Release; 944 | }; 945 | /* End XCConfigurationList section */ 946 | }; 947 | rootObject = 107938911F3B7529000F287A /* Project object */; 948 | } 949 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/Door.h: -------------------------------------------------------------------------------- 1 | // 2 | // Door.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Door : NSObject 12 | 13 | - (void)getDescription; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/Door.m: -------------------------------------------------------------------------------- 1 | // 2 | // Door.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Door.h" 10 | 11 | @implementation Door 12 | 13 | - (void)getDescription { 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/DoorFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoorFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Door; 12 | @class DoorInstaller; 13 | 14 | @protocol DoorFactory 15 | 16 | + (Door *)createDoor; 17 | + (DoorInstaller *)createDoorInstall; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/DoorInstaller.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoorInstaller.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DoorInstaller : NSObject 12 | 13 | - (void)getDescription; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/DoorInstaller.m: -------------------------------------------------------------------------------- 1 | // 2 | // DoorInstaller.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "DoorInstaller.h" 10 | 11 | @implementation DoorInstaller 12 | 13 | - (void)getDescription { 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoor.h: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoor.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Door.h" 11 | 12 | @interface IronDoor : Door 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoor.m: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoor.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "IronDoor.h" 10 | 11 | @implementation IronDoor 12 | 13 | - (void)getDescription { 14 | NSLog(@"I am a iron door"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoorFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoorFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DoorFactory.h" 11 | 12 | @interface IronDoorFactory : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoorFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoorFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "IronDoorFactory.h" 10 | #import "IronDoor.h" 11 | #import "IronDoorInstaller.h" 12 | 13 | @implementation IronDoorFactory 14 | 15 | + (Door *)createDoor { 16 | return [[IronDoor alloc] init]; 17 | } 18 | 19 | + (DoorInstaller *)createDoorInstall { 20 | return [[IronDoorInstaller alloc] init]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoorInstaller.h: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoorInstaller.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DoorInstaller.h" 11 | 12 | @interface IronDoorInstaller : DoorInstaller 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/IronDoorInstaller.m: -------------------------------------------------------------------------------- 1 | // 2 | // IronDoorInstaller.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "IronDoorInstaller.h" 10 | 11 | @implementation IronDoorInstaller 12 | 13 | - (void)getDescription { 14 | NSLog(@"I am a iron door installer"); 15 | } 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoor.h: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoor.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Door.h" 11 | 12 | @interface WoodDoor : Door 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoor.m: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoor.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WoodDoor.h" 10 | 11 | @implementation WoodDoor 12 | 13 | - (void)getDescription { 14 | NSLog(@"I am a wood door"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoorFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoorFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DoorFactory.h" 11 | 12 | @interface WoodDoorFactory : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoorFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoorFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WoodDoorFactory.h" 10 | #import "WoodDoor.h" 11 | #import "WoodDoorInstaller.h" 12 | 13 | @implementation WoodDoorFactory 14 | 15 | + (Door *)createDoor { 16 | return [[WoodDoor alloc] init]; 17 | } 18 | 19 | + (DoorInstaller *)createDoorInstall { 20 | return [[WoodDoorInstaller alloc] init]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoorInstaller.h: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoorInstaller.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DoorInstaller.h" 11 | 12 | @interface WoodDoorInstaller : DoorInstaller 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/AbstractFactory/WoodDoorInstaller.m: -------------------------------------------------------------------------------- 1 | // 2 | // WoodDoorInstaller.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/21. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WoodDoorInstaller.h" 10 | 11 | @implementation WoodDoorInstaller 12 | 13 | - (void)getDescription { 14 | NSLog(@"I am a wood door installer"); 15 | } 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/InternationalConference.h: -------------------------------------------------------------------------------- 1 | // 2 | // InternationalConference.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 国际会议 13 | */ 14 | @protocol InternationalConference 15 | 16 | /** 17 | 英语演讲 18 | */ 19 | - (void)englishSpeech; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/SpeakChinese.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpeakChinese.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SpeakChinese : NSObject 12 | 13 | - (void)chineseSpeech; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/SpeakChinese.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpeakChinese.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "SpeakChinese.h" 10 | 11 | @implementation SpeakChinese 12 | 13 | - (void)chineseSpeech { 14 | NSLog(@"如果孩子们继续以前的学习方法,只知道记背算这些,我可以保持30年后孩子们都找不到工作"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/SpeakEnglish.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpeakEnglish.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "InternationalConference.h" 11 | 12 | @interface SpeakEnglish : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/SpeakEnglish.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpeakEnglish.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "SpeakEnglish.h" 10 | 11 | @implementation SpeakEnglish 12 | 13 | - (void)englishSpeech { 14 | NSLog(@"I heard that no company is hiring for iOS developer, ba la ba la"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/Translator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Translator.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "InternationalConference.h" 11 | @interface Translator : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Adapter/Translator.m: -------------------------------------------------------------------------------- 1 | // 2 | // Translator.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/29. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Translator.h" 10 | #import "SpeakChinese.h" 11 | 12 | @implementation Translator 13 | 14 | - (void)englishSpeech { 15 | SpeakChinese *MrMa = [[SpeakChinese alloc] init]; 16 | [MrMa chineseSpeech]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/App.h: -------------------------------------------------------------------------------- 1 | // 2 | // App.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol App 12 | 13 | /** 14 | 模块说明 15 | */ 16 | + (NSString *)moduleDescription; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/BlueTheme.h: -------------------------------------------------------------------------------- 1 | // 2 | // BlueTheme.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Theme.h" 11 | 12 | @interface BlueTheme : Theme 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/BlueTheme.m: -------------------------------------------------------------------------------- 1 | // 2 | // BlueTheme.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "BlueTheme.h" 10 | 11 | @implementation BlueTheme 12 | 13 | - (NSString *)getColor { 14 | return @"blue"; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/ChatModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatModule.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Module.h" 11 | 12 | @interface ChatModule : Module 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/ChatModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatModule.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ChatModule.h" 10 | #import "Theme.h" 11 | 12 | @implementation ChatModule 13 | 14 | + (NSString *)moduleDescription { 15 | return @"聊天模块"; 16 | } 17 | 18 | + (void)moduleDescriptionWithTheme:(Theme *)theme { 19 | NSLog(@"%@-%@", [ChatModule moduleDescription], [theme getColor]); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/Module.h: -------------------------------------------------------------------------------- 1 | // 2 | // Module.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "App.h" 11 | 12 | @class Theme; 13 | @interface Module : NSObject 14 | 15 | + (void)moduleDescriptionWithTheme:(Theme *)theme; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/Module.m: -------------------------------------------------------------------------------- 1 | // 2 | // Module.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Module.h" 10 | 11 | @implementation Module 12 | 13 | + (NSString *)moduleDescription { 14 | return @""; 15 | } 16 | 17 | + (void)moduleDescriptionWithTheme:(Theme *)theme { 18 | } 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/MyModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyModule.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Module.h" 11 | 12 | @interface MyModule : Module 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/MyModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyModule.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "MyModule.h" 10 | #import "Theme.h" 11 | 12 | @implementation MyModule 13 | 14 | + (NSString *)moduleDescription { 15 | return @"我的模块"; 16 | } 17 | 18 | + (void)moduleDescriptionWithTheme:(Theme *)theme { 19 | NSLog(@"%@-%@", [MyModule moduleDescription], [theme getColor]); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/RedTheme.h: -------------------------------------------------------------------------------- 1 | // 2 | // RedTheme.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Theme.h" 11 | 12 | @interface RedTheme : Theme 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/RedTheme.m: -------------------------------------------------------------------------------- 1 | // 2 | // RedTheme.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "RedTheme.h" 10 | 11 | @implementation RedTheme 12 | 13 | - (NSString *)getColor { 14 | return @"red"; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/Theme.h: -------------------------------------------------------------------------------- 1 | // 2 | // Theme.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ThemeInfo.h" 11 | 12 | @interface Theme : NSObject 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/Theme.m: -------------------------------------------------------------------------------- 1 | // 2 | // Theme.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Theme.h" 10 | 11 | @implementation Theme 12 | 13 | - (NSString *)getColor { 14 | return @""; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Bridge/ThemeInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // Theme.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/30. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ThemeInfo 12 | 13 | - (NSString *)getColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/FiveYuanNoSpicyBuild.h: -------------------------------------------------------------------------------- 1 | // 2 | // FiveYuanNoSpicyBuild.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HandWheatCakeBuilder.h" 11 | 12 | @interface FiveYuanNoSpicyBuild : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/FiveYuanNoSpicyBuild.m: -------------------------------------------------------------------------------- 1 | // 2 | // FiveYuanNoSpicyBuild.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "FiveYuanNoSpicyBuild.h" 10 | 11 | @implementation FiveYuanNoSpicyBuild 12 | 13 | - (void)addFood { 14 | NSLog(@"生菜 + 火腿肠 + 鸡蛋"); 15 | } 16 | 17 | - (void)addcondiment { 18 | NSLog(@"味精 + 番茄酱"); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/HandWheatCake.h: -------------------------------------------------------------------------------- 1 | // 2 | // HandWheatCake.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HandWheatCake : NSObject 12 | 13 | @property (nonatomic, copy) NSString *food; ///< 配菜 14 | @property (nonatomic, copy) NSString *condiment; ///< 调味 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/HandWheatCake.m: -------------------------------------------------------------------------------- 1 | // 2 | // HandWheatCake.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "HandWheatCake.h" 10 | 11 | @implementation HandWheatCake 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/HandWheatCakeBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // HandWheatCakeBuilder.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol HandWheatCakeBuilder 12 | 13 | - (void)addFood; 14 | - (void)addcondiment; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/Seller.h: -------------------------------------------------------------------------------- 1 | // 2 | // Seller.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HandWheatCakeBuilder.h" 11 | 12 | @interface Seller : NSObject 13 | 14 | @property (nonatomic, strong) id handWheatCakeBuilder; 15 | 16 | - (void)cookFood; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/Seller.m: -------------------------------------------------------------------------------- 1 | // 2 | // Seller.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Seller.h" 10 | 11 | @implementation Seller 12 | 13 | - (void)cookFood { 14 | [self.handWheatCakeBuilder addFood]; 15 | [self.handWheatCakeBuilder addcondiment]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/TenYuanAbnormalSpicyBuild.h: -------------------------------------------------------------------------------- 1 | // 2 | // TenYuanAbnormalSpicyBuild.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HandWheatCakeBuilder.h" 11 | 12 | @interface TenYuanAbnormalSpicyBuild : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Builder/TenYuanAbnormalSpicyBuild.m: -------------------------------------------------------------------------------- 1 | // 2 | // TenYuanAbnormalSpicyBuild.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/22. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "TenYuanAbnormalSpicyBuild.h" 10 | 11 | @implementation TenYuanAbnormalSpicyBuild 12 | 13 | - (void)addFood { 14 | NSLog(@"生菜 + 热狗 + 肉松 + 里脊 + 芝士"); 15 | } 16 | 17 | - (void)addcondiment { 18 | NSLog(@"辣椒 + 辣酱 + 麻酱 + 干辣椒 + 剁辣椒 + 老干妈 + 辣椒油"); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/CEO.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEO.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Manager.h" 10 | 11 | @interface CEO : Manager 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/CEO.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEO.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "CEO.h" 10 | 11 | @implementation CEO 12 | 13 | - (void)handleLeaveApplication:(NSUInteger)dayCount { 14 | if (dayCount < 20) { 15 | NSLog(@"CEO:我很忙去找你上司"); 16 | return; 17 | } 18 | if (dayCount < 30) { 19 | NSLog(@"dayCount:%ld----CEO:Bug都写完了吗?那就去吧", dayCount); 20 | } else { 21 | NSLog(@"dayCount:%ld----CEO:世界那么大你是不是也想出去看看?回去写你的Bug", dayCount); 22 | } 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/CTO.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTO.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Manager.h" 10 | 11 | @interface CTO : Manager 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/CTO.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTO.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "CTO.h" 10 | 11 | @implementation CTO 12 | 13 | - (void)handleLeaveApplication:(NSUInteger)dayCount { 14 | if (dayCount < 10) { 15 | NSLog(@"CTO:我很忙,这种小事别烦我"); 16 | return; 17 | } 18 | if (dayCount < 20) { 19 | NSLog(@"dayCount:%ld----CTO:又请假相亲啊,去吧去吧~", dayCount); 20 | } else { 21 | if (self.superior != nil) { 22 | NSLog(@"dayCount:%ld----CTO:又请假相亲啊,我没权利批假,去问一下我的老大吧~", dayCount); 23 | [self.superior handleLeaveApplication:dayCount]; 24 | } 25 | } 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/Leave.h: -------------------------------------------------------------------------------- 1 | // 2 | // Leave.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol Leave 12 | 13 | - (void)handleLeaveApplication:(NSUInteger)dayCount; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/Manager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Manager.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Leave.h" 11 | 12 | @interface Manager : NSObject 13 | 14 | @property (nonatomic, strong) id superior; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/Manager.m: -------------------------------------------------------------------------------- 1 | // 2 | // Manager.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Manager.h" 10 | 11 | @implementation Manager 12 | 13 | - (void)handleLeaveApplication:(NSUInteger)dayCount { 14 | } 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/PM.h: -------------------------------------------------------------------------------- 1 | // 2 | // PM.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Manager.h" 10 | 11 | @interface PM : Manager 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/ChainOfResponsibility/PM.m: -------------------------------------------------------------------------------- 1 | // 2 | // PM.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/7. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "PM.h" 10 | 11 | @implementation PM 12 | 13 | - (void)handleLeaveApplication:(NSUInteger)dayCount { 14 | 15 | if (dayCount < 10) { 16 | NSLog(@"dayCount:%ld----PM:请假跟女朋友去旅游啊,调试完这个bug就走吧。过来你看,你的程序报错了:\"找不到对象\"", dayCount); 17 | } else { 18 | if (self.superior != nil) { 19 | NSLog(@"dayCount:%ld----PM:请假跟女朋友去旅游啊,我没权利批假,去问一下我的老大吧", dayCount); 20 | [self.superior handleLeaveApplication:dayCount]; 21 | } 22 | } 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/AbaloneCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // AbaloneCommand.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Command.h" 11 | 12 | /** 13 | 鲍鱼 14 | */ 15 | @interface AbaloneCommand : Command 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/AbaloneCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // AbaloneCommand.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "AbaloneCommand.h" 10 | 11 | @implementation AbaloneCommand 12 | 13 | - (void)execute { 14 | [self.cook cookAbalone]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Command.h: -------------------------------------------------------------------------------- 1 | // 2 | // Command.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CommandProtocol.h" 11 | #import "Cook.h" 12 | 13 | @interface Command : NSObject 14 | 15 | @property (nonatomic, strong, readonly) Cook *cook; 16 | 17 | - (instancetype)initWithReceiver:(Cook *)cook; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Command.m: -------------------------------------------------------------------------------- 1 | // 2 | // Command.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Command.h" 10 | 11 | @implementation Command 12 | 13 | - (void)execute { 14 | } 15 | 16 | - (void)cancleCommand { 17 | } 18 | 19 | - (instancetype)initWithReceiver:(Cook *)cook { 20 | if (self = [super init]) { 21 | _cook = cook; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/CommandProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommandProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol CommandProtocol 12 | 13 | @required 14 | /** 15 | 执行指令 16 | */ 17 | - (void)execute; 18 | 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Cook.h: -------------------------------------------------------------------------------- 1 | // 2 | // Cook.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Cook : NSObject 12 | 13 | /** 14 | 制作龙虾 15 | */ 16 | - (void)cookLobster; 17 | 18 | /** 19 | 制作鲍鱼 20 | */ 21 | - (void)cookAbalone; 22 | 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Cook.m: -------------------------------------------------------------------------------- 1 | // 2 | // Cook.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Cook.h" 10 | 11 | /** 12 | 厨子 13 | */ 14 | @implementation Cook 15 | 16 | - (void)cookLobster { 17 | NSLog(@"制作好了龙虾"); 18 | } 19 | - (void)cookAbalone { 20 | NSLog(@"制作好了鲍鱼"); 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/LobsterCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // LobsterCommand.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Command.h" 11 | 12 | /** 13 | 龙虾 14 | */ 15 | @interface LobsterCommand : Command 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/LobsterCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // LobsterCommand.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "LobsterCommand.h" 10 | 11 | @implementation LobsterCommand 12 | 13 | - (void)execute { 14 | [self.cook cookLobster]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Waiter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Waiter.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CommandProtocol.h" 11 | 12 | /** 13 | 服务员 14 | */ 15 | @interface Waiter : NSObject 16 | 17 | /** 18 | 点菜 19 | */ 20 | - (void)addOrder:(id )command; 21 | 22 | /** 23 | 全点好了 24 | */ 25 | - (void)submmitOrder; 26 | 27 | /** 28 | 取消菜 29 | */ 30 | - (void)cancleOrder:(id )command; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Command/Waiter.m: -------------------------------------------------------------------------------- 1 | // 2 | // Waiter.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Waiter.h" 10 | 11 | @interface Waiter() 12 | 13 | @property (nonatomic, strong) NSMutableArray *commandQueue; 14 | 15 | @end 16 | 17 | @implementation Waiter 18 | 19 | - (instancetype)init { 20 | if (self = [super init]) { 21 | self.commandQueue = [[NSMutableArray alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)addOrder:(id )command { 27 | [_commandQueue addObject:command]; 28 | } 29 | 30 | - (void)submmitOrder { 31 | for (id command in _commandQueue) { 32 | [command execute]; 33 | } 34 | [_commandQueue removeAllObjects]; 35 | } 36 | 37 | - (void)cancleOrder:(id )command { 38 | if ([_commandQueue containsObject:command]) { 39 | [_commandQueue removeObject:command]; 40 | NSLog(@"取消成功"); 41 | } else { 42 | NSLog(@"已经不可以取消了"); 43 | } 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/File.h: -------------------------------------------------------------------------------- 1 | // 2 | // File.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FileSystem.h" 11 | 12 | @interface File : NSObject 13 | 14 | @property (nonatomic, copy, readonly) NSString *name; 15 | 16 | - (instancetype)initWithName:(NSString *)name; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/File.m: -------------------------------------------------------------------------------- 1 | // 2 | // File.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "File.h" 10 | 11 | @implementation File 12 | 13 | - (instancetype)initWithName:(NSString *)name { 14 | if (self = [super init]) { 15 | _name = name; 16 | } 17 | return self; 18 | } 19 | 20 | - (void)displayWithHierarchy:(NSUInteger)hierarchy { 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/FileSystem.h: -------------------------------------------------------------------------------- 1 | // 2 | // FileSystem.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol FileSystem 12 | 13 | - (void)displayWithHierarchy:(NSUInteger)hierarchy; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/Folder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Folder.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FileSystem.h" 11 | 12 | @interface Folder : NSObject 13 | 14 | @property (nonatomic, copy, readonly) NSString *name; 15 | @property (nonatomic, strong, readonly) NSMutableArray *filesArray; 16 | 17 | - (instancetype)initWithName:(NSString *)name; 18 | - (void)addFile:(id )file; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/Folder.m: -------------------------------------------------------------------------------- 1 | // 2 | // Folder.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Folder.h" 10 | 11 | @interface Folder () 12 | 13 | @end 14 | 15 | @implementation Folder 16 | 17 | - (instancetype)initWithName:(NSString *)name { 18 | if (self = [super init]) { 19 | _name = name; 20 | _filesArray = [[NSMutableArray alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)displayWithHierarchy:(NSUInteger)hierarchy { 26 | NSInteger temp = hierarchy; 27 | hierarchy++; 28 | NSMutableString *prefix = [[NSMutableString alloc] initWithString:@""]; 29 | while (temp--) { 30 | [prefix appendString:@"-"]; 31 | } 32 | NSLog(@"%@目录:%@", prefix, self.name); 33 | for (NSInteger i = 0; i < _filesArray.count; i++) { 34 | [_filesArray[i] displayWithHierarchy:hierarchy]; 35 | } 36 | } 37 | 38 | - (void)addFile:(id )file { 39 | [_filesArray addObject:file]; 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/HeaderFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderFile.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FileSystem.h" 11 | #import "File.h" 12 | 13 | @interface HeaderFile : File 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/HeaderFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderFile.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "HeaderFile.h" 10 | 11 | @implementation HeaderFile 12 | 13 | - (void)displayWithHierarchy:(NSUInteger)hierarchy { 14 | 15 | NSMutableString *prefix = [[NSMutableString alloc] initWithString:@""]; 16 | while (hierarchy--) { 17 | [prefix appendString:@"-"]; 18 | } 19 | NSLog(@"%@头文件:%@.h", prefix, self.name); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/ImplementationFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImplementationFile.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FileSystem.h" 11 | #import "File.h" 12 | 13 | @interface ImplementationFile : File 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Composite/ImplementationFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImplementationFile.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by MaLi on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ImplementationFile.h" 10 | 11 | @implementation ImplementationFile 12 | 13 | - (void)displayWithHierarchy:(NSUInteger)hierarchy { 14 | NSMutableString *prefix = [[NSMutableString alloc] initWithString:@""]; 15 | while (hierarchy--) { 16 | [prefix appendString:@"-"]; 17 | } 18 | NSLog(@"%@实现文件:%@.m", prefix, self.name); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/ChickenBurger.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChickenBurger.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Humburger.h" 11 | 12 | @interface ChickenBurger : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/ChickenBurger.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChickenBurger.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ChickenBurger.h" 10 | 11 | @implementation ChickenBurger 12 | 13 | - (NSString *)getDescription { 14 | return @"鸡肉堡"; 15 | } 16 | - (NSInteger)getCost { 17 | return 10; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Chilli.h: -------------------------------------------------------------------------------- 1 | // 2 | // Chilli.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Condiment.h" 10 | 11 | @interface Chilli : Condiment 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Chilli.m: -------------------------------------------------------------------------------- 1 | // 2 | // Chilli.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Chilli.h" 10 | 11 | @implementation Chilli 12 | 13 | - (NSString *)getDescription { 14 | return [NSString stringWithFormat:@"%@+辣椒粉", [self.burger getDescription]]; 15 | } 16 | - (NSInteger)getCost { 17 | return [self.burger getCost] + 1; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Condiment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Condiment.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChickenBurger.h" 11 | #import "Humburger.h" 12 | 13 | @interface Condiment : NSObject 14 | 15 | @property (nonatomic, strong, readonly) ChickenBurger *burger; 16 | 17 | - (instancetype)initWithChickenBurger:(id)burger; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Condiment.m: -------------------------------------------------------------------------------- 1 | // 2 | // Condiment.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Condiment.h" 10 | 11 | @implementation Condiment 12 | 13 | - (instancetype)initWithChickenBurger:(id)burger { 14 | if (self = [super init]) { 15 | _burger = burger; 16 | } 17 | return self; 18 | } 19 | 20 | - (NSString *)getDescription { 21 | return @""; 22 | } 23 | - (NSInteger)getCost { 24 | return 0; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Egg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Egg.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/4. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Condiment.h" 10 | 11 | @interface Egg : Condiment 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Egg.m: -------------------------------------------------------------------------------- 1 | // 2 | // Egg.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/4. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Egg.h" 10 | 11 | @implementation Egg 12 | 13 | - (NSString *)getDescription { 14 | return [NSString stringWithFormat:@"%@+煎蛋", [self.burger getDescription]]; 15 | } 16 | - (NSInteger)getCost { 17 | return [self.burger getCost] + 2; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Decorator/Humburger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Humburger.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/3. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol Humburger 12 | 13 | - (NSString *)getDescription; 14 | - (NSInteger)getCost; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/Curtain.h: -------------------------------------------------------------------------------- 1 | // 2 | // Curtain.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Curtain : NSObject 12 | 13 | + (void)up; 14 | + (void)down; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/Curtain.m: -------------------------------------------------------------------------------- 1 | // 2 | // Curtain.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Curtain.h" 10 | 11 | @implementation Curtain 12 | 13 | + (void)up { 14 | NSLog(@"已经打开了窗帘"); 15 | } 16 | 17 | + (void)down { 18 | NSLog(@"已经拉上了窗帘"); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/HouseManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // HouseManager.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HouseManager : NSObject 12 | 13 | - (void)sleep; 14 | 15 | - (void)getUp; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/HouseManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // HouseManager.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "HouseManager.h" 10 | #import "Light.h" 11 | #import "Curtain.h" 12 | 13 | @implementation HouseManager 14 | 15 | - (void)sleep { 16 | [Curtain down]; 17 | [Light off]; 18 | } 19 | 20 | - (void)getUp { 21 | [Light on]; 22 | [Curtain up]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/Light.h: -------------------------------------------------------------------------------- 1 | // 2 | // Light.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Light : NSObject 12 | 13 | + (void)on; 14 | + (void)off; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Facade/Light.m: -------------------------------------------------------------------------------- 1 | // 2 | // Light.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/1. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Light.h" 10 | 11 | @implementation Light 12 | 13 | + (void)on { 14 | NSLog(@"开灯了"); 15 | } 16 | 17 | + (void)off { 18 | NSLog(@"关灯了"); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/BlackHuman.h: -------------------------------------------------------------------------------- 1 | // 2 | // BlackHuman.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Human.h" 10 | 11 | @interface BlackHuman : Human 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/BlackHuman.m: -------------------------------------------------------------------------------- 1 | // 2 | // BlackHuman.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "BlackHuman.h" 10 | 11 | @implementation BlackHuman 12 | 13 | - (void)talk { 14 | NSLog(@"我是黑种人"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/BlackHumanFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // BlackHumanFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HumanFactory.h" 11 | 12 | @interface BlackHumanFactory : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/BlackHumanFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // BlackHumanFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "BlackHumanFactory.h" 10 | #import "BlackHuman.h" 11 | 12 | @implementation BlackHumanFactory 13 | 14 | + (Human *)createHuman { 15 | return [[BlackHuman alloc] init]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/Human.h: -------------------------------------------------------------------------------- 1 | // 2 | // Human.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Human : NSObject 12 | 13 | - (void)talk; 14 | 15 | @end 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/Human.m: -------------------------------------------------------------------------------- 1 | // 2 | // Human.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Human.h" 10 | 11 | @implementation Human 12 | 13 | - (void)talk { 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/HumanFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // HumanFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Human; 12 | @protocol HumanFactory 13 | 14 | + (Human *)createHuman; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/NuWa.h: -------------------------------------------------------------------------------- 1 | // 2 | // NuWa.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NuWa : NSObject 12 | 13 | + (void)someMagic; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/NuWa.m: -------------------------------------------------------------------------------- 1 | // 2 | // NuWa.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "NuWa.h" 10 | #import "WhiteHumanFactory.h" 11 | #import "YellowHumanFactory.h" 12 | #import "BlackHumanFactory.h" 13 | #import "Human.h" 14 | 15 | @implementation NuWa 16 | 17 | + (void)someMagic { 18 | Human *whiteMan = [WhiteHumanFactory createHuman]; 19 | [whiteMan talk]; 20 | Human *yellowMan = [YellowHumanFactory createHuman]; 21 | [yellowMan talk]; 22 | Human *blackMan = [BlackHumanFactory createHuman]; 23 | [blackMan talk]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/WhiteHuman.h: -------------------------------------------------------------------------------- 1 | // 2 | // WhiteHuman.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Human.h" 10 | 11 | @interface WhiteHuman : Human 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/WhiteHuman.m: -------------------------------------------------------------------------------- 1 | // 2 | // WhiteHuman.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WhiteHuman.h" 10 | 11 | @implementation WhiteHuman 12 | 13 | - (void)talk { 14 | NSLog(@"我是白种人"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/WhiteHumanFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // WhiteHumanFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HumanFactory.h" 11 | 12 | @interface WhiteHumanFactory : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/WhiteHumanFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // WhiteHumanFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WhiteHumanFactory.h" 10 | #import "WhiteHuman.h" 11 | 12 | @implementation WhiteHumanFactory 13 | 14 | + (Human *)createHuman { 15 | return [[WhiteHuman alloc] init]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/YellowHuman.h: -------------------------------------------------------------------------------- 1 | // 2 | // YellowHuman.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Human.h" 10 | 11 | @interface YellowHuman : Human 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/YellowHuman.m: -------------------------------------------------------------------------------- 1 | // 2 | // YellowHuman.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "YellowHuman.h" 10 | 11 | @implementation YellowHuman 12 | 13 | - (void)talk { 14 | NSLog(@"我是黄种人"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/YellowHumanFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // YellowHumanFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HumanFactory.h" 11 | 12 | @interface YellowHumanFactory : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/FactoryMethod/YellowHumanFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // YellowHumanFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "YellowHumanFactory.h" 10 | #import "YellowHuman.h" 11 | 12 | @implementation YellowHumanFactory 13 | 14 | + (Human *)createHuman { 15 | return [[YellowHuman alloc] init]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Flyweight/Circle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Circle.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Shape.h" 11 | 12 | @interface Circle : NSObject 13 | 14 | - (instancetype)initWithColorString:(NSString *)colorString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Flyweight/Circle.m: -------------------------------------------------------------------------------- 1 | // 2 | // Circle.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Circle.h" 10 | 11 | @interface Circle() 12 | 13 | @property (nonatomic, copy) NSString *colorString; 14 | 15 | @end 16 | 17 | @implementation Circle 18 | 19 | - (instancetype)initWithColorString:(NSString *)colorString { 20 | if (self = [super init]) { 21 | _colorString = colorString; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)draw { 27 | NSLog(@"画了一个%@的圆形", _colorString); 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Flyweight/FlyweightFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlyweightFactory.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Circle.h" 11 | 12 | @interface FlyweightFactory : NSObject 13 | 14 | - (Circle *)createCircleWithColorString:(NSString *)colorString; 15 | 16 | - (void)getCount; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Flyweight/FlyweightFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // FlyweightFactory.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "FlyweightFactory.h" 10 | 11 | @interface FlyweightFactory() 12 | 13 | @property (nonatomic, strong) NSDictionary *circleDictionary; 14 | 15 | @end 16 | 17 | @implementation FlyweightFactory 18 | 19 | - (instancetype)init { 20 | if (self = [super init]) { 21 | _circleDictionary = [[NSMutableDictionary alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (Circle *)createCircleWithColorString:(NSString *)colorString { 27 | Circle *circle = [_circleDictionary objectForKey:colorString]; 28 | if (circle == nil) { 29 | circle = [[Circle alloc] initWithColorString:colorString]; 30 | [_circleDictionary setValue:circle forKey:colorString]; 31 | } 32 | return circle; 33 | } 34 | 35 | - (void)getCount { 36 | NSLog(@"一共创建了%ld个圆", _circleDictionary.count); 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Flyweight/Shape.h: -------------------------------------------------------------------------------- 1 | // 2 | // Shape.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol Shape 12 | 13 | - (void)draw; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Mediator/ChatRoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatRoom.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/12. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MediatorProtocol.h" 11 | 12 | @interface ChatRoom : NSObject 13 | 14 | - (void)showMessage:(NSString *)message userName:(NSString *)name; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Mediator/ChatRoom.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatRoom.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/12. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ChatRoom.h" 10 | 11 | @implementation ChatRoom 12 | 13 | - (void)showMessage:(NSString *)message { 14 | NSLog(@"%@\n",message); 15 | } 16 | 17 | - (void)showMessage:(NSString *)message userName:(NSString *)name { 18 | NSString *string = [NSString stringWithFormat:@"%@:%@", name, message]; 19 | [self showMessage:string]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Mediator/MediatorProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // MediatorProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/12. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol MediatorProtocol 12 | 13 | - (void)showMessage:(NSString *)message; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Mediator/User.h: -------------------------------------------------------------------------------- 1 | // 2 | // User.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/12. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChatRoom.h" 11 | 12 | @interface User : NSObject 13 | 14 | - (instancetype)initWithName:(NSString *)name room:(ChatRoom *)room; 15 | 16 | - (void)sendMessage:(NSString *)message; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Mediator/User.m: -------------------------------------------------------------------------------- 1 | // 2 | // User.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/12. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "User.h" 10 | 11 | @interface User() 12 | 13 | @property (nonatomic, copy) NSString *name; ///< 用户昵称 14 | @property (nonatomic, strong) ChatRoom *room; ///< 当前聊天室 15 | 16 | @end 17 | 18 | @implementation User 19 | 20 | - (instancetype)initWithName:(NSString *)name room:(ChatRoom *)room { 21 | if (self = [super init]) { 22 | _name = name; 23 | _room = room; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)sendMessage:(NSString *)message { 29 | [_room showMessage:message userName:_name]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Memento/Editor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Editor.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EditorMemento; 12 | @interface Editor : NSObject 13 | 14 | - (void)insertContent:(NSString *)string; 15 | - (EditorMemento *)save; 16 | - (void)echo; 17 | - (void)restore:(EditorMemento *)memento; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Memento/Editor.m: -------------------------------------------------------------------------------- 1 | // 2 | // Editor.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Editor.h" 10 | #import "EditorMemento.h" 11 | 12 | @interface Editor() 13 | 14 | @property (nonatomic, strong) NSMutableArray *array; 15 | @property (nonatomic, strong) EditorMemento *memento; 16 | 17 | @end 18 | 19 | @implementation Editor 20 | 21 | - (instancetype)init { 22 | if (self = [super init]) { 23 | _array = [[NSMutableArray alloc] init]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)insertContent:(NSString *)string { 29 | [_array addObject:string]; 30 | } 31 | 32 | - (EditorMemento *)save { 33 | return [[EditorMemento alloc] initWithArray:[_array copy]]; 34 | } 35 | 36 | - (void)echo { 37 | for (NSString *string in _array) { 38 | NSLog(@"%@", string); 39 | } 40 | } 41 | 42 | - (void)restore:(EditorMemento *)memento { 43 | _array = [[NSMutableArray alloc] initWithArray:memento.array]; 44 | } 45 | 46 | - (EditorMemento *)memento { 47 | if (!_memento) { 48 | _memento = [[EditorMemento alloc] initWithArray:[_array copy]]; 49 | } 50 | return _memento; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Memento/EditorMemento.h: -------------------------------------------------------------------------------- 1 | // 2 | // EditorMemento.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EditorMemento : NSObject 12 | 13 | @property (nonatomic, copy, readonly) NSArray *array; 14 | - (instancetype)initWithArray:(NSArray *)array; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Memento/EditorMemento.m: -------------------------------------------------------------------------------- 1 | // 2 | // EditorMemento.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "EditorMemento.h" 10 | 11 | @implementation EditorMemento 12 | 13 | - (instancetype)initWithArray:(NSArray *)array { 14 | if (self = [super init]) { 15 | _array = array; 16 | } 17 | return self; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/JobHunter.h: -------------------------------------------------------------------------------- 1 | // 2 | // JobHunter.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ObserverProtocol.h" 11 | 12 | @interface JobHunter : NSObject 13 | 14 | - (instancetype)initWithName:(NSString *)name; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/JobHunter.m: -------------------------------------------------------------------------------- 1 | // 2 | // JobHunter.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "JobHunter.h" 10 | 11 | @interface JobHunter() 12 | 13 | @property (nonatomic, copy) NSString *name; 14 | 15 | @end 16 | 17 | @implementation JobHunter 18 | 19 | - (instancetype)initWithName:(NSString *)name { 20 | if (self = [super init]) { 21 | _name = name; 22 | } 23 | return self; 24 | } 25 | 26 | 27 | - (void)update { 28 | NSLog(@"%@:有一个新的职位更新啦",_name); 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/JobProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // JobProvider.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SubjectProtocol.h" 11 | 12 | @interface JobProvider : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/JobProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // JobProvider.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "JobProvider.h" 10 | 11 | @interface JobProvider() 12 | 13 | @property (nonatomic, strong) NSMutableArray *observers; 14 | 15 | @end 16 | 17 | @implementation JobProvider 18 | 19 | - (void)addObserver:(NSObject *)observer { 20 | [self.observers addObject:observer]; 21 | } 22 | - (void)removeObserver:(NSObject *)observer { 23 | [self.observers removeObject:observer]; 24 | } 25 | - (void)notify { 26 | for (id observer in self.observers) { 27 | [observer update]; 28 | } 29 | } 30 | 31 | - (NSMutableArray *)observers { 32 | if (!_observers) { 33 | _observers = [[NSMutableArray alloc] init]; 34 | } 35 | return _observers; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/ObserverProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObserverProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ObserverProtocol 12 | 13 | - (void)update; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Observer/SubjectProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // SubjectProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/13. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ObserverProtocol.h" 11 | 12 | @protocol SubjectProtocol 13 | 14 | - (void)addObserver:(id )observer; 15 | - (void)removeObserver:(id )observer; 16 | - (void)notify; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/Company.h: -------------------------------------------------------------------------------- 1 | // 2 | // Company.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/11. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 公司类 13 | */ 14 | @interface Company : NSObject 15 | 16 | @property (nonatomic, strong) NSString *name; ///< 公司名字 17 | @property (nonatomic, strong) NSString *establishmentTime;///< 成立时间 18 | @property (nonatomic, strong) NSString *level; ///< 规模 19 | 20 | - (instancetype)initWithName:(NSString *)name establishmentTime:(NSString *)establishmentTime level:(NSString *)level; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/Company.m: -------------------------------------------------------------------------------- 1 | // 2 | // Company.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/11. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Company.h" 10 | 11 | @implementation Company 12 | 13 | - (instancetype)initWithName:(NSString *)name establishmentTime:(NSString *)establishmentTime level:(NSString *)level { 14 | if (self = [super init]) { 15 | _name = name; 16 | _establishmentTime = establishmentTime; 17 | _level = level; 18 | } 19 | return self; 20 | } 21 | 22 | - (id)copyWithZone:(NSZone *)zone { 23 | Company *company = [[Company allocWithZone:zone] init]; 24 | company.name = [self.name copy]; 25 | company.establishmentTime = [self.establishmentTime copy]; 26 | company.level = [self.level copy]; 27 | return company; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/Employee.h: -------------------------------------------------------------------------------- 1 | // 2 | // Employee.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/11. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Company.h" 11 | 12 | /** 13 | 雇员类 14 | */ 15 | @interface Employee : NSObject 16 | 17 | @property (nonatomic, strong) NSString *name; ///< 姓名 18 | @property (nonatomic, assign) NSInteger age; ///< 年龄 19 | @property (nonatomic, strong) NSString *department; ///< 部门 20 | 21 | @property (nonatomic, strong) Company *company; ///< 公司信息 22 | 23 | 24 | - (instancetype)initWithName:(NSString *)name configWithAge:(NSInteger)age department:(NSString *)department company:(Company *)company; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/Employee.m: -------------------------------------------------------------------------------- 1 | // 2 | // Employee.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/11. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Employee.h" 10 | 11 | @implementation Employee 12 | 13 | - (instancetype)initWithName:(NSString *)name configWithAge:(NSInteger)age department:(NSString *)department company:(Company *)company { 14 | if (self = [super init]) { 15 | _name = name; 16 | _age = age; 17 | _department = department; 18 | _company = company; 19 | } 20 | return self; 21 | } 22 | 23 | - (id)copyWithZone:(NSZone *)zone { 24 | return nil; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/EmployeeDeepCopy.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmployeeDeepCopy.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/14. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Employee.h" 10 | 11 | /** 12 | 雇员深复制类 13 | */ 14 | @interface EmployeeDeepCopy : Employee 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/EmployeeDeepCopy.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmployeeDeepCopy.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/14. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "EmployeeDeepCopy.h" 10 | 11 | @implementation EmployeeDeepCopy 12 | 13 | - (id)copyWithZone:(NSZone *)zone { 14 | Employee *employee = [[Employee allocWithZone:zone] init]; 15 | employee.name = [self.name copy]; 16 | employee.age = self.age; 17 | employee.department = [self.department copy]; 18 | employee.company = [self.company copy]; 19 | return employee; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/EmployeeShallowCopy.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmployeeShallowCopy.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/14. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Employee.h" 10 | 11 | /** 12 | 雇员浅复制类 13 | */ 14 | @interface EmployeeShallowCopy : Employee 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Prototype/EmployeeShallowCopy.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmployeeShallowCopy.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/14. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "EmployeeShallowCopy.h" 10 | 11 | @implementation EmployeeShallowCopy 12 | 13 | - (id)copyWithZone:(NSZone *)zone { 14 | Employee *employee = [[Employee allocWithZone:zone] init]; 15 | employee.name = self.name; 16 | employee.age = self.age; 17 | employee.department = self.department; 18 | employee.company = self.company; 19 | return employee; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Proxy/Ticket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Ticket.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol Ticket 12 | 13 | - (void)sell; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Proxy/TicketOutlets.h: -------------------------------------------------------------------------------- 1 | // 2 | // TicketOutlets.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Ticket.h" 11 | 12 | @interface TicketOutlets : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Proxy/TicketOutlets.m: -------------------------------------------------------------------------------- 1 | // 2 | // TicketOutlets.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "TicketOutlets.h" 10 | #import "TrainStation.h" 11 | 12 | @interface TicketOutlets() 13 | 14 | @property (nonatomic, strong) TrainStation *trainStain; 15 | 16 | @end 17 | 18 | @implementation TicketOutlets 19 | 20 | - (instancetype)init { 21 | if (self = [super init]) { 22 | _trainStain = [[TrainStation alloc] init]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)sell { 28 | NSLog(@"收取代售手续费5元"); 29 | [_trainStain sell]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Proxy/TrainStation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TrainStation.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Ticket.h" 11 | 12 | @interface TrainStation : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Proxy/TrainStation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TrainStation.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/9/5. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "TrainStation.h" 10 | 11 | @implementation TrainStation 12 | 13 | - (void)sell { 14 | NSLog(@"火车票已经成功卖出"); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Singleton/Singleton.h: -------------------------------------------------------------------------------- 1 | // 2 | // Singleton.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Singleton : NSObject 12 | 13 | + (instancetype)sharedInstance; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Singleton/Singleton.m: -------------------------------------------------------------------------------- 1 | // 2 | // Singleton.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/15. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Singleton.h" 10 | 11 | @implementation Singleton 12 | 13 | + (instancetype)sharedInstance { 14 | static id shareInstance; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | shareInstance = [[self alloc] init]; 18 | }); 19 | return shareInstance; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/BallPen.h: -------------------------------------------------------------------------------- 1 | // 2 | // BallPen.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DrawProtocol.h" 11 | 12 | @interface BallPen : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/BallPen.m: -------------------------------------------------------------------------------- 1 | // 2 | // BallPen.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "BallPen.h" 10 | 11 | @implementation BallPen 12 | 13 | - (void)drawContent:(NSString *)string { 14 | NSLog(@"用圆珠笔书写了:%@", string); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/DrawProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // DrawProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DrawProtocol 12 | 13 | - (void)drawContent:(NSString *)string; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/Pen.h: -------------------------------------------------------------------------------- 1 | // 2 | // Pen.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DrawProtocol.h" 11 | 12 | @interface Pen : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/Pen.m: -------------------------------------------------------------------------------- 1 | // 2 | // Pen.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Pen.h" 10 | 11 | @implementation Pen 12 | 13 | - (void)drawContent:(NSString *)string { 14 | NSLog(@"用钢笔书写了:%@", string); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/TextEditor.h: -------------------------------------------------------------------------------- 1 | // 2 | // TextEditor.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DrawProtocol.h" 11 | 12 | @interface TextEditor : NSObject 13 | 14 | @property (nonatomic, strong) id state; 15 | 16 | - (instancetype)initWithState:(id )state; 17 | 18 | - (void)echo:(NSString *)content; 19 | 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/TextEditor.m: -------------------------------------------------------------------------------- 1 | // 2 | // TextEditor.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "TextEditor.h" 10 | 11 | @implementation TextEditor 12 | 13 | - (instancetype)initWithState:(id)state { 14 | if (self = [super init]) { 15 | self.state = state; 16 | } 17 | return self; 18 | } 19 | 20 | - (void)echo:(NSString *)content { 21 | [self.state drawContent:content]; 22 | } 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/WritingBrush.h: -------------------------------------------------------------------------------- 1 | // 2 | // WritingBrush.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DrawProtocol.h" 11 | 12 | @interface WritingBrush : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/State/WritingBrush.m: -------------------------------------------------------------------------------- 1 | // 2 | // WritingBrush.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "WritingBrush.h" 10 | 11 | @implementation WritingBrush 12 | 13 | - (void)drawContent:(NSString *)string { 14 | NSLog(@"用毛笔书写了:%@", string); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/BubbleSortStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleSortStrategy.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "StrategyProtocol.h" 11 | 12 | @interface BubbleSortStrategy : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/BubbleSortStrategy.m: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleSortStrategy.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "BubbleSortStrategy.h" 10 | 11 | @implementation BubbleSortStrategy 12 | 13 | + (void)sort:(NSArray *)array { 14 | NSLog(@"Array's count=%ld, 使用了冒泡排序", array.count); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/QuickSortStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // QuickSortStrategy.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "StrategyProtocol.h" 11 | 12 | @interface QuickSortStrategy : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/QuickSortStrategy.m: -------------------------------------------------------------------------------- 1 | // 2 | // QuickSortStrategy.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "QuickSortStrategy.h" 10 | 11 | @implementation QuickSortStrategy 12 | 13 | + (void)sort:(NSArray *)array { 14 | NSLog(@"Array's count=%ld, 使用了快速排序", array.count); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/Sort.h: -------------------------------------------------------------------------------- 1 | // 2 | // Sort.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "StrategyProtocol.h" 11 | 12 | @interface Sort : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/Sort.m: -------------------------------------------------------------------------------- 1 | // 2 | // Sort.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Sort.h" 10 | #import "BubbleSortStrategy.h" 11 | #import "QuickSortStrategy.h" 12 | 13 | @implementation Sort 14 | 15 | + (void)sort:(NSArray *)array { 16 | if (array.count > 5) { 17 | [QuickSortStrategy sort:array]; 18 | } else { 19 | [BubbleSortStrategy sort:array]; 20 | } 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Strategy/StrategyProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // StrategyProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/16. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol StrategyProtocol 12 | 13 | + (void)sort:(NSArray *)array; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/AndroidPublish.h: -------------------------------------------------------------------------------- 1 | // 2 | // AndroidPublish.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Publish.h" 10 | 11 | @interface AndroidPublish : Publish 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/AndroidPublish.m: -------------------------------------------------------------------------------- 1 | // 2 | // AndroidPublish.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "AndroidPublish.h" 10 | 11 | @implementation AndroidPublish 12 | 13 | - (void)code { 14 | NSLog(@"编写Android代码"); 15 | } 16 | - (void)test { 17 | NSLog(@"测试Android代码"); 18 | } 19 | - (void)pack { 20 | NSLog(@"混淆代码,打包"); 21 | } 22 | - (void)upload { 23 | NSLog(@"上传到各种应用商店"); 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/Publish.h: -------------------------------------------------------------------------------- 1 | // 2 | // Publish.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PublishProtocol.h" 11 | 12 | @interface Publish : NSObject 13 | 14 | - (void)publish; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/Publish.m: -------------------------------------------------------------------------------- 1 | // 2 | // Publish.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Publish.h" 10 | 11 | @implementation Publish 12 | 13 | - (void)publish { 14 | [self code]; 15 | [self test]; 16 | [self pack]; 17 | [self upload]; 18 | } 19 | 20 | - (void)code { 21 | } 22 | - (void)test { 23 | } 24 | - (void)pack { 25 | } 26 | - (void)upload { 27 | } 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/PublishProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // PublishProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol PublishProtocol 12 | 13 | - (void)code; 14 | - (void)test; 15 | - (void)pack; 16 | - (void)upload; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/iOSPublish.h: -------------------------------------------------------------------------------- 1 | // 2 | // iOSPublish.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "Publish.h" 10 | 11 | @interface iOSPublish : Publish 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/TemplateMethod/iOSPublish.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // iOSPublish.m 4 | // MLDesignPatterns-OC 5 | // 6 | // Created by mjpc on 2017/10/17. 7 | // Copyright © 2017年 mali. All rights reserved. 8 | // 9 | 10 | #import "iOSPublish.h" 11 | 12 | @implementation iOSPublish 13 | 14 | - (void)code { 15 | NSLog(@"编写iOS代码"); 16 | } 17 | - (void)test { 18 | NSLog(@"测试iOS代码"); 19 | } 20 | - (void)pack { 21 | NSLog(@"xcode archive"); 22 | } 23 | - (void)upload { 24 | NSLog(@"上传到AppStore"); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/ActionProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | @protocol PersonProtocol; 11 | 12 | @protocol ActionProtocol 13 | 14 | - (void)positiveConclusion:(id )positive; 15 | - (void)negativeConclusion:(id )negavite; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/HalfCupWater.h: -------------------------------------------------------------------------------- 1 | // 2 | // HalfCupWater.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ActionProtocol.h" 11 | 12 | @interface HalfCupWater : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/HalfCupWater.m: -------------------------------------------------------------------------------- 1 | // 2 | // HalfCupWater.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "HalfCupWater.h" 10 | 11 | @implementation HalfCupWater 12 | 13 | - (void)positiveConclusion:(id )positive { 14 | NSLog(@"乐观的人:还有半杯水可以喝"); 15 | } 16 | - (void)negativeConclusion:(id )negavite { 17 | NSLog(@"悲观的人:只剩半杯水了啊"); 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/NegativePerson.h: -------------------------------------------------------------------------------- 1 | // 2 | // NegativePerson.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PersonProtocol.h" 11 | 12 | @interface NegativePerson : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/NegativePerson.m: -------------------------------------------------------------------------------- 1 | // 2 | // NegativePerson.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "NegativePerson.h" 10 | 11 | @implementation NegativePerson 12 | 13 | - (void)accept:(id )visitor { 14 | [visitor negativeConclusion:[[NegativePerson alloc] init]]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/ObjectStructure.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectStructure.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PersonProtocol.h" 11 | #import "ActionProtocol.h" 12 | 13 | @interface ObjectStructure : NSObject 14 | 15 | - (void)add:(id )person; 16 | - (void)remove:(id )person; 17 | - (void)echo:(id )action; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/ObjectStructure.m: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectStructure.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "ObjectStructure.h" 10 | 11 | @interface ObjectStructure() 12 | 13 | @property (nonatomic, strong) NSMutableArray *array; 14 | 15 | @end 16 | 17 | @implementation ObjectStructure 18 | 19 | - (instancetype)init { 20 | if (self = [super init]) { 21 | _array = [[NSMutableArray alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)add:(id )person { 27 | [_array addObject:person]; 28 | } 29 | 30 | - (void)remove:(id )person { 31 | [_array removeObject:person]; 32 | } 33 | 34 | - (void)echo:(id )action { 35 | for (id person in _array) { 36 | [person accept:action]; 37 | } 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/PersonProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // PersonProtocol.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ActionProtocol.h" 11 | 12 | @protocol PersonProtocol 13 | 14 | - (void)accept:(id )visitor; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/PositivePerson.h: -------------------------------------------------------------------------------- 1 | // 2 | // PositivePerson.h 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PersonProtocol.h" 11 | 12 | @interface PositivePerson : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/Visitor/PositivePerson.m: -------------------------------------------------------------------------------- 1 | // 2 | // PositivePerson.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/10/17. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import "PositivePerson.h" 10 | 11 | @implementation PositivePerson 12 | 13 | - (void)accept:(id )visitor { 14 | [visitor positiveConclusion:[[PositivePerson alloc] init]]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MLDesignPatterns-OC/MLDesignPatterns-OC/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MLDesignPatterns-OC 4 | // 5 | // Created by mjpc on 2017/8/10. 6 | // Copyright © 2017年 mali. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NuWa.h" 11 | #import "Door.h" 12 | #import "DoorInstaller.h" 13 | #import "WoodDoorFactory.h" 14 | #import "IronDoorFactory.h" 15 | #import "Seller.h" 16 | #import "FiveYuanNoSpicyBuild.h" 17 | #import "TenYuanAbnormalSpicyBuild.h" 18 | #import "Employee.h" 19 | #import "Company.h" 20 | #import "EmployeeDeepCopy.h" 21 | #import "EmployeeShallowCopy.h" 22 | #import "SpeakEnglish.h" 23 | #import "Translator.h" 24 | #import "MyModule.h" 25 | #import "ChatModule.h" 26 | #import "RedTheme.h" 27 | #import "BlueTheme.h" 28 | #import "Folder.h" 29 | #import "HeaderFile.h" 30 | #import "ImplementationFile.h" 31 | #import "HouseManager.h" 32 | #import "ChickenBurger.h" 33 | #import "Chilli.h" 34 | #import "Egg.h" 35 | #import "FlyweightFactory.h" 36 | #import "Circle.h" 37 | #import "TicketOutlets.h" 38 | #import "CEO.h" 39 | #import "CTO.h" 40 | #import "PM.h" 41 | #import "Waiter.h" 42 | #import "Cook.h" 43 | #import "LobsterCommand.h" 44 | #import "AbaloneCommand.h" 45 | #import "User.h" 46 | #import "ChatRoom.h" 47 | #import "JobProvider.h" 48 | #import "JobHunter.h" 49 | #import "EditorMemento.h" 50 | #import "Editor.h" 51 | #import "Sort.h" 52 | #import "ObjectStructure.h" 53 | #import "NegativePerson.h" 54 | #import "PositivePerson.h" 55 | #import "HalfCupWater.h" 56 | #import "iOSPublish.h" 57 | #import "AndroidPublish.h" 58 | #import "TextEditor.h" 59 | #import "BallPen.h" 60 | #import "Pen.h" 61 | #import "WritingBrush.h" 62 | 63 | #warning Please look at the main method to debug. 64 | 65 | void factoryMethod() { 66 | [NuWa someMagic]; 67 | } 68 | 69 | void abstractFactory() { 70 | Door *woodDoor = [WoodDoorFactory createDoor]; 71 | DoorInstaller *woodDoorInstaller = [WoodDoorFactory createDoorInstall]; 72 | [woodDoor getDescription]; 73 | [woodDoorInstaller getDescription]; 74 | 75 | Door *ironDoor = [IronDoorFactory createDoor]; 76 | DoorInstaller *ironDoorInstaller = [IronDoorFactory createDoorInstall]; 77 | [ironDoor getDescription]; 78 | [ironDoorInstaller getDescription]; 79 | } 80 | 81 | void builder() { 82 | FiveYuanNoSpicyBuild *fiveBuilder = [[FiveYuanNoSpicyBuild alloc] init]; 83 | TenYuanAbnormalSpicyBuild *tenBuilder = [[TenYuanAbnormalSpicyBuild alloc] init]; 84 | Seller *aSeller = [[Seller alloc] init]; 85 | aSeller.handWheatCakeBuilder = fiveBuilder; 86 | [aSeller cookFood]; 87 | aSeller.handWheatCakeBuilder = tenBuilder; 88 | [aSeller cookFood]; 89 | } 90 | 91 | void prototype() { 92 | Company *sina = [[Company alloc] initWithName:@"新浪" establishmentTime:@"2014-08-08" level:@"上市"]; 93 | Company *alibaba = [[Company alloc] initWithName:@"阿里巴巴" establishmentTime:@"2008-08-08" level:@"上市"]; 94 | EmployeeShallowCopy *zhangSan = [[EmployeeShallowCopy alloc] initWithName:@"张三" configWithAge:20 department:@"IT" company:sina]; 95 | EmployeeDeepCopy *zhangsanDeep = [[EmployeeDeepCopy alloc] initWithName:@"张三deep" configWithAge:20 department:@"IT" company:alibaba]; 96 | EmployeeShallowCopy *liSi = [zhangSan copy]; 97 | sina.name = @"浪里个浪"; 98 | NSLog(@"%@", liSi.company.name); 99 | EmployeeDeepCopy *wangWu = [zhangsanDeep copy]; 100 | alibaba.name = @"新阿里巴巴"; 101 | NSLog(@"%@", wangWu.company.name); 102 | } 103 | 104 | void adapter() { 105 | SpeakEnglish *SteveJobs = [[SpeakEnglish alloc] init]; 106 | [SteveJobs englishSpeech]; 107 | Translator *MrMaTranslator = [[Translator alloc] init]; 108 | [MrMaTranslator englishSpeech]; 109 | } 110 | 111 | void bridge() { 112 | RedTheme *red = [[RedTheme alloc] init]; 113 | BlueTheme *blue = [[BlueTheme alloc] init]; 114 | 115 | [MyModule moduleDescriptionWithTheme:red]; 116 | [ChatModule moduleDescriptionWithTheme:blue]; 117 | } 118 | 119 | void decorator() { 120 | ChickenBurger *chickenBurger = [[ChickenBurger alloc] init]; 121 | NSLog(@"%@-花费:%ld", [chickenBurger getDescription], [chickenBurger getCost]); 122 | Chilli *chilliBurger = [[Chilli alloc] initWithChickenBurger:chickenBurger]; 123 | NSLog(@"%@-花费:%ld", [chilliBurger getDescription], [chilliBurger getCost]); 124 | Egg *eggBurger = [[Egg alloc] initWithChickenBurger:chickenBurger]; 125 | NSLog(@"%@-花费:%ld", [eggBurger getDescription], [eggBurger getCost]); 126 | Egg *eggChilliBurger = [[Egg alloc] initWithChickenBurger:chilliBurger]; 127 | NSLog(@"%@-花费:%ld", [eggChilliBurger getDescription], [eggChilliBurger getCost]); 128 | } 129 | 130 | void composite() { 131 | Folder *folder = [[Folder alloc] initWithName:@"MLDesignPatterns-OC"]; 132 | Folder *compositefolder = [[Folder alloc] initWithName:@"Composite"]; 133 | [folder addFile:compositefolder]; 134 | ImplementationFile *mainFile = [[ImplementationFile alloc] initWithName:@"main"]; 135 | [folder addFile:mainFile]; 136 | HeaderFile *fileHeaderFile = [[HeaderFile alloc] initWithName:@"File"]; 137 | ImplementationFile *fileImplementationFile = [[ImplementationFile alloc] initWithName:@"File"]; 138 | HeaderFile *fileSystemHeaderFile = [[HeaderFile alloc] initWithName:@"FileSystem"]; 139 | HeaderFile *folderHeaderFile = [[HeaderFile alloc] initWithName:@"Folder"]; 140 | ImplementationFile *folderImplementationFile = [[ImplementationFile alloc] initWithName:@"Folder"]; 141 | HeaderFile *headerFileHeaderFile = [[HeaderFile alloc] initWithName:@"HeaderFile"]; 142 | ImplementationFile *headerFileImplementationFile = [[ImplementationFile alloc] initWithName:@"HeaderFile"]; 143 | HeaderFile *implementationFileHeaderFile = [[HeaderFile alloc] initWithName:@"ImplementationFile"]; 144 | ImplementationFile *implementationFileImplementationFile = [[ImplementationFile alloc] initWithName:@"ImplementationFile"]; 145 | [compositefolder addFile:fileHeaderFile]; 146 | [compositefolder addFile:fileImplementationFile]; 147 | [compositefolder addFile:fileSystemHeaderFile]; 148 | [compositefolder addFile:folderHeaderFile]; 149 | [compositefolder addFile:folderImplementationFile]; 150 | [compositefolder addFile:headerFileHeaderFile]; 151 | [compositefolder addFile:headerFileImplementationFile]; 152 | [compositefolder addFile:implementationFileHeaderFile]; 153 | [compositefolder addFile:implementationFileImplementationFile]; 154 | [folder displayWithHierarchy:0]; 155 | } 156 | 157 | void facede() { 158 | HouseManager *manager = [[HouseManager alloc] init]; 159 | NSLog(@"--------------- 准备睡觉了 ---------------"); 160 | [manager sleep]; 161 | NSLog(@"--------------- 准备起床了 ---------------"); 162 | [manager getUp]; 163 | } 164 | 165 | void flyWeight() { 166 | FlyweightFactory *factory = [[FlyweightFactory alloc] init]; 167 | Circle *redCircle1 = [factory createCircleWithColorString:@"红色"]; 168 | Circle *redCircle2 = [factory createCircleWithColorString:@"红色"]; 169 | Circle *blueCircle1 = [factory createCircleWithColorString:@"蓝色"]; 170 | Circle *blueCircle2 = [factory createCircleWithColorString:@"蓝色"]; 171 | Circle *redCircle3 = [factory createCircleWithColorString:@"红色"]; 172 | [redCircle1 draw]; 173 | [redCircle2 draw]; 174 | [blueCircle1 draw]; 175 | [blueCircle2 draw]; 176 | [redCircle3 draw]; 177 | [factory getCount]; 178 | } 179 | 180 | void proxy() { 181 | TicketOutlets *ticketOutlets = [[TicketOutlets alloc] init]; 182 | [ticketOutlets sell]; 183 | } 184 | 185 | void chainOfResponsibility() { 186 | CEO *ceo = [[CEO alloc] init]; 187 | CTO *cto = [[CTO alloc] init]; 188 | PM *pm = [[PM alloc] init]; 189 | pm.superior = cto; 190 | cto.superior = ceo; 191 | 192 | NSArray *leaveApplicationArray = @[@"1", @"16", @"25", @"31"]; 193 | for (NSString *string in leaveApplicationArray) { 194 | [pm handleLeaveApplication:[string integerValue]]; 195 | } 196 | } 197 | 198 | void command() { 199 | Waiter *waiter = [[Waiter alloc] init]; 200 | Cook *stephenChow = [[Cook alloc] init]; 201 | LobsterCommand *lobsterCommand = [[LobsterCommand alloc] initWithReceiver:stephenChow]; 202 | AbaloneCommand *abaloneCommand = [[AbaloneCommand alloc] initWithReceiver:stephenChow]; 203 | 204 | [waiter addOrder:lobsterCommand]; 205 | [waiter addOrder:abaloneCommand]; 206 | [waiter submmitOrder]; 207 | [waiter cancleOrder:lobsterCommand]; 208 | } 209 | 210 | void mediator() { 211 | ChatRoom *room = [[ChatRoom alloc] init]; 212 | User *wuJun = [[User alloc] initWithName:@"吴军" room:room]; 213 | User *me = [[User alloc] initWithName:@"SuperMario" room:room]; 214 | [wuJun sendMessage:@"来自硅谷的第一封信"]; 215 | [me sendMessage:@"谢谢,不做伪工作者"]; 216 | } 217 | 218 | void observer() { 219 | JobHunter *zhangSan = [[JobHunter alloc] initWithName:@"张三"]; 220 | JobHunter *liSi = [[JobHunter alloc] initWithName:@"李四"]; 221 | JobProvider *jobProvider = [[JobProvider alloc] init]; 222 | [jobProvider addObserver:zhangSan]; 223 | [jobProvider addObserver:liSi]; 224 | [jobProvider notify]; 225 | } 226 | 227 | void memento() { 228 | Editor *editor = [[Editor alloc] init]; 229 | [editor insertContent:@"总熬夜会带来三个问题"]; 230 | [editor insertContent:@"第一:记忆力会明显下降"]; 231 | [editor insertContent:@"第二:数数经常会数错"]; 232 | EditorMemento *memento = [editor save]; 233 | [editor insertContent:@"第四:记忆力会明显下降"]; 234 | [editor echo]; 235 | NSLog(@"//------------------------------------"); 236 | [editor restore:memento]; 237 | [editor echo]; 238 | } 239 | 240 | void strategy() { 241 | NSArray *array = @[@"1", @"44", @"3"]; 242 | NSArray *largeArray = @[@"1", @"44", @"3", @"12", @"424", @"33", @"145", @"544", @"36", @"17", @"844", @"38"]; 243 | [Sort sort:array]; 244 | [Sort sort:largeArray]; 245 | } 246 | 247 | void visitor() { 248 | ObjectStructure *structure = [[ObjectStructure alloc] init]; 249 | [structure add:[[PositivePerson alloc] init]]; 250 | [structure add:[[NegativePerson alloc] init]]; 251 | HalfCupWater *action = [[HalfCupWater alloc] init]; 252 | [structure echo:action]; 253 | } 254 | 255 | void templateMethod() { 256 | iOSPublish *iOS = [[iOSPublish alloc] init]; 257 | [iOS publish]; 258 | NSLog(@"---------我是华丽丽的分割线------------"); 259 | AndroidPublish *android = [[AndroidPublish alloc] init]; 260 | [android publish]; 261 | } 262 | 263 | void state() { 264 | TextEditor *editor = [[TextEditor alloc] initWithState:[[BallPen alloc] init]]; 265 | [editor echo:@"硅谷来信第三封:再谈1W小时,三板斧破四困境"]; 266 | editor.state = [[Pen alloc] init]; 267 | [editor echo:@"学习-实践"]; 268 | editor.state = [[WritingBrush alloc] init]; 269 | [editor echo:@"掌握-教授"]; 270 | } 271 | 272 | int main(int argc, const char * argv[]) { 273 | @autoreleasepool { 274 | 275 | // factoryMethod(); 276 | // abstractFactory(); 277 | // builder(); 278 | // prototype(); 279 | // adapter(); 280 | // bridge(); 281 | // decorator(); 282 | // composite(); 283 | // facede(); 284 | // flyWeight(); 285 | // proxy(); 286 | // chainOfResponsibility(); 287 | // command(); 288 | // mediator(); 289 | // observer(); 290 | // memento(); 291 | // strategy(); 292 | // visitor(); 293 | // templateMethod(); 294 | // state(); 295 | } 296 | return 0; 297 | } 298 | 299 | 300 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Read Me 3 | 此仓库用Objective-C实现23种设计模式以及架构型模式(MVX模式以及变种),陆续完善中... 4 | 5 | 设计模式大致可分三种类型以及MVX系列,所以总共分了4篇来讲解:`创建型模式篇`,`结构性模式篇`,`行为型模式篇`,`架构型模式`。本仓库主要保存文章中的一些设计模式的Demo。由于个人能力有限,难免有一些遗漏或者错误,请各位看官不吝赐教!谢谢! 6 | 7 | 8 | Type | Article 9 | ---|--- 10 | 创建型模式 | http://www.jianshu.com/p/55f0e3b30e9c 11 | 结构性模式 | http://www.jianshu.com/p/8ae41a48021b 12 | 行为型模式 | http://www.jianshu.com/p/2eaff81c082a 13 | 架构型模式 | 14 | 15 | --- 16 | 17 | ⭐⭐⭐如果觉得本仓库对您有帮助,请不要吝啬你的Star⭐。您的支持将鼓励我继续创作!⭐⭐⭐ 18 | 19 | --------------------------------------------------------------------------------