fork / path_registry
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
commit d34d81734664b5ccacd9502d1a0b5ddd8a23d51a
tree 6c3c47367ed984bc0706538e4b6f568c853080e7
parent e352bc7996866e08db85f25d5d865e1261a0e59e
tree 6c3c47367ed984bc0706538e4b6f568c853080e7
parent e352bc7996866e08db85f25d5d865e1261a0e59e
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README.rdoc | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
install/ | ||
| |
lib/ | ||
| |
tasks/ | ||
| |
test/ |
README.rdoc
PathRegistry
Warum ein Register für Pfade?
- automatische Generierung einer Sitemap
module PathRegistry
registered_path do def self.sitemap Sitemap.new self.all end endend
sitemap = RegisteredLinks.sitemap
- Hilfe zur Verlinkung von internen Seiten
class NavigationController < ApplicationController
# ... def new @navigation = Navigation.new @paths = @navigation.registered_paths end # ...end
Wie ist die "PathRegistry" aufgebaut (UML)?
- Nutzer und Anbieter
- Ereignisse und Strategien
- Registrierte Links
<SETUP>
cd <yourapp>
script/plugin install git://github.org/fork/path_registry
rake db:migrate
$EDITOR config/path_registry.rb
notifies ...
registered_path { ... }
<USAGE>
registeres_path ... uses_registered_path ...
Welche Ziele gab es (mit Beispielen)?
- Composed Method Pattern - Kent Beck (are comments code smells?)
- Strategy Pattern (ActionController::Base.respond_to {} => on… {})
- Erweiterbarkeit (wenig Grundfunktionalität)
- Verantwortlichkeit (DRY)
- Testbarkeit (Test-Suites wie RSpec, Expectations oder test/spec)
- Vererbbarkeit (Probleme mit Hash als "inheritable_attribute")

