surrounded:创建对象的封装系统,并专注于它们的交互

时间:2021-05-07 02:45:17
【文件属性】:
文件名称:surrounded:创建对象的封装系统,并专注于它们的交互
文件大小:42KB
文件格式:ZIP
更新时间:2021-05-07 02:45:17
Ruby 控制业务逻辑。 环绕式旨在通过将内聚性行为保持在一起来帮助您更好地管理业务逻辑。 将对象放在一起以实现您的用例并仅在必要时获得行为。 如何思考你的物体 首先,命名您要解决的问题。 然后,将您的问题分解为负责任的角色。 将您的问题名称用作类,并使用Surrounded::Context对其进行扩展 它可能看起来像这样: class Employment extend Surrounded :: Context role :boss role :employee end 在您的应用程序中,您将使用对象初始化此类以扮演您定义的角色,因此您需要指定哪些角色播放器将使用哪个角色。 class Employment extend Surrounded :: Context initialize :employee , :boss role :boss role :
【文件预览】:
surrounded-master
----.github()
--------workflows()
----LICENSE.txt(1KB)
----surrounded.gemspec(922B)
----.simplecov(42B)
----lib()
--------surrounded()
--------surrounded.rb(1010B)
----Gemfile(110B)
----.codeclimate.yml(51B)
----Rakefile(388B)
----examples()
--------rails.rb(1020B)
--------bottles.rb(2KB)
----test()
--------surrounded_test.rb(1KB)
--------non_surrounded_role_player_test.rb(622B)
--------example_delegate_class_test.rb(636B)
--------test_helper.rb(541B)
--------context_reuse_test.rb(906B)
--------context_shortcuts_test.rb(1KB)
--------example_proxy_test.rb(3KB)
--------example_threaded_test.rb(1KB)
--------initialization_test.rb(2KB)
--------role_context_method_test.rb(3KB)
--------casting_role_player_test.rb(122B)
--------context_forwarding_test.rb(2KB)
--------surrounded_context_test.rb(5KB)
--------east_oriented_triggers_test.rb(918B)
--------context_access_test.rb(2KB)
--------name_collisions_test.rb(4KB)
--------example_wrapper_test.rb(592B)
--------collection_role_players_test.rb(1KB)
--------override_methods_test.rb(1KB)
----README.md(35KB)
----.pullreview.yml(54B)
----.gitignore(171B)
----Changelog.md(993B)

网友评论