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.

Symfony/Rails/Laravel/Django/Flask

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

Rails Middleware for XSLT

Implementation

# 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

# config/application.rb
config.middleware.use "XsltRenderer"

Custom Model

# 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

Data Model

# 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

Output

<!-- 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>

Caching

References

CQRS

gRPC

XMPP

ESB

XQuery

GraphQL

⚠️ **GitHub.com Fallback** ⚠️