App Framework Interop - sgml/signature GitHub Wiki
CQRS means that your read and write models become separate. Instead of interacting directly with the underlying datamodel, you will collect mutations on content using Event Sourcing (ES). This means that the events are collected very fast.
Apache HTTPD Module¹ | Ruby on Rails Equivalent² | Drupal Equivalent³ | Django Equivalent⁴ | Spring MVC Equivalent⁵ |
---|---|---|---|---|
mod_rewrite¹ | rack-rewrite² | Redirect module³ | django-urls⁴ | spring-webmvc⁵ |
mod_php | Passenger | PHP is used for backend processing | Django with WSGI | Spring with Servlets |
mod_headers | rack-headers | Drupal Header module | django-headers | spring-webmvc |
mod_security | rack-security | Drupal uses .htaccess for security | django-security | spring-security |
mod_proxy | rack-proxy | N/A | django-proxy | spring-proxy |
mod_filter | rack-filter | Drupal Filter module | django-filter | spring-filter |
mod_cache | rack-cache | Drupal Cache API | django-cache | spring-cache |
mod_dav | N/A | Drupal WebDAV module | django-dav | N/A |
mod_env | rack-env | Drupal Environment Indicator | django-environ | spring-env |
mod_file_cache | N/A | Drupal Cache API | django-file-cache | N/A |
mod_info | N/A | N/A | django-info | spring-info |
mod_heartbeat | N/A | N/A | django-heartbeat | spring-heartbeat |
mod_so | N/A | N/A | django-so | spring-so |
mod_status | N/A | N/A | django-status | spring-status |
mod_wsgi | Phusion Passenger | N/A | django-wsgi | spring-wsgi |
# lib/middleware/xslt_renderer.rb
class XsltRenderer
def initialize(app)
@app = app
end
def call(env)
status, headers, response = @app.call(env)
if headers['Content-Type'] == 'application/xml'
xslt = Nokogiri::XSLT(File.read('path/to/your_stylesheet.xsl'))
xml = Nokogiri::XML(response.body)
# Check and get the version of the XSLT processor
xslt_processor_version = xslt.doc.xpath('/xsl:stylesheet/@version', 'xsl' => 'http://www.w3.org/1999/XSL/Transform').text
# Set the version as a parameter
transformed_response = xslt.transform(xml, 'xslt_processor_version' => xslt_processor_version).to_s
Rails.logger.info "XSLT Processor Version: #{xslt_processor_version}"
headers['Content-Length'] = transformed_response.bytesize.to_s
[status, headers, [transformed_response]]
else
[status, headers, response]
end
end
end
# config/application.rb
config.middleware.use "XsltRenderer"
# app/models/book.rb
class Book < ApplicationRecord
def to_xml(options = {})
Nokogiri::XML::Builder.new do |xml|
xml.book {
xml.title title
xml.author author
xml.published_at published_at
}
end.to_xml
end
end
# app/models/book.rb
class Book < ApplicationRecord
def to_xml(options = {})
Nokogiri::XML::Builder.new do |xml|
xml.book {
xml.title title
xml.author author
xml.published_at published_at
}
end.to_xml
end
end
<!-- path/to/your_stylesheet.xsl -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="xslt_processor_version"/>
<xsl:template match="/">
<html>
<body>
<h1>XSLT Processor Version: <xsl:value-of select="$xslt_processor_version"/></h1>
<!-- Add other transformation logic here -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>
- https://rubygarage.org/blog/ruby-on-rails-and-symfony-comparison
- https://steelkiwi.com/blog/ruby-django-laravel-frameworks-comparison/
- https://blog.arkency.com/2017/05/whats-inside-the-rails-ddd-workshop-application/
- https://blog.arkency.com/2015/07/testing-event-sourced-application/
- https://www.thedigitalcatonline.com/blog/2016/11/14/clean-architectures-in-python-a-step-by-step-example/