SlideShare a Scribd company logo
Django in Enterprise World
PyCon4
9 May, 2010
Simone Federici
s.federici@gmail.com
Obiettivo
Django è sulla bocca di tutti, è un full stack framework che ha
messo una pietra di storia nel mondo python, e non solo. 
Ma perchè, in Italia, le grandi aziende per il web non riescono
a uscire dal tunnel J2EE/JSF o, peggio, Struts?
In questo talk porto alla luce differenze sostanziali di
approccio alle problematiche comuni di applicazioni web, e
ad architetture più complesse Enterprise. Ma cosa significa
Enterprise? Tutto ciò che i clienti definiscono Enterprise lo è
veramente?
Come javista che pythonista, parlerò di cosa il mondo java
rimprovera al mondo python e come ho scoperto che le
accuse fanno acqua...
Agenda
• Mini Django Overview (ma dovreste già conoscerlo)
• Enterprise World
o Multi Tiers (client, web, business, EIS)
o Conteiners, WebServices (SOA)
o Transactions
• Development
• Deployments
• Scalability, Accessibility, and Manageability
• Q?
Django mini overview (1)
class Reporter(models.Model):
full_name = models.CharField(max_length=70)
def __unicode__(self):
return self.full_name
class Article(models.Model):
pub_date = models.DateTimeField()
headline = models.CharField(max_length=200)
content = models.TextField()
reporter = odels.ForeignKey(Reporter)
def __unicode__(self):
return self.headline
manage.py syncdb
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^articles/(d{4})/$', 'mysite.views.year_archive'),
(r'^articles/(d{4})/(d{2})/$', 'mysite.views.month_archive'),
(r'^articles/(d{4})/(d{2})/(d+)/$', 'mysite.views.article_detail'), )
import models from django.contrib import admin
admin.site.register(models.Article)
Django mini overview (2)
def year_archive(request, year):
a_list = Article.objects.filter(pub_date__year=year)
return render_to_response('news/year_archive.html', {'year': year, 'article_list': a_list})
{% extends "base.html" %}
{% block title %}Articles for {{ year }}{% endblock %}
{% block content %}
<h1>Articles for {{ year }}</h1>
{% for article in article_list %}
<p>{{ article.headline }}</p>
<p>By {{ article.reporter.full_name }}</p>
<p>Published {{ article.pub_date|date:"F j, Y" }}</p>
{% endfor %}
{% endblock %}
Django mini overview (4)
from django.forms import ModelForm
class ArticleForm(ModelForm):
class Meta:
model = Article
exclude = ('title',)
ArticleForm(request.POST).save()
ArticleForm(instance=Article.objects.get(pk=1)).save()
ArticleForm(request.POST, instance=Article.objects.get(pk=pk)).save()
<form action="/form/" method="post">
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
Django mini overview (4)
Authentication backends
Middleware
Validators
Commands
Custom model fields
Custom template tags
Custom template filters
Custom storage system
PDF, CVS, JSON, XML
Jython
Deploying
Legacy database
Error reporting via e-mail
Initial data
Managing files
Testing Django applications
Django’s cache framework
Conditional View Processing
Sending e-mail
Internationalization and localization
Pagination
Serializing Django objects
Django settings
Signals
A lot of pluggable applications...
South (Data and DDL migrations)
New Django 1.2 Features
• Model Validation
• Multi Database
Enterprise World
Defines an architecture for implementing services as
multitier applications that deliver the scalability,
accessibility, and manageability needed by enterprise-
level applications.
Distributed multitiered application model
• Web
o browser
o ajax
o flash
o flex
• GUI
• Batch
• DB
• Legacy
• NO SQL
• FTP
• Remote
• JMS!
• Persistence
Entities
• Session Beans
• Message-
Driven Beans
• Presentation-oriented
o GET,
o HEAD,
o POST,
o PUT,
o DELETE
• Service-oriented (WS)
o XML-RPC
o SOA
o REST
o JSON
EE Containers
Centralized Configuration
• JNDI
• Datasource e Connection Pool (DB tuning)
• Mail Server (SMTP configuration)
• Enterprise JavaBeans (EJB) container
• Web container
• Application client container
• Applet container
Web Tier
Web Applications
• Servlet
• Filters
• Session Listner
• CustomTag
• Locale
• JSF (why?)
Web Services
• XML
• SOAPTransport
Protocol
• WSDL Standard
Format
• UDDI and XML
Standard Formats
• Attachments
• Authentication
Business Tier
Local and RemoteEnterprise bean is a server-side component that encapsulates the business logic of
an application. For several reasons, enterprise beans simplify the development
of large, distributed applications.
• the bean developer can concentrate on solving business problems because the
container is responsible for system-level services such as transaction
management and security authorization.
• the client developer can focus on the presentation of the client. The client
developer does not have to code the routines that implement business rules or
access databases.
• because enterprise beans are portable components, the application assembler
can build new applications from existing beans.
When
• The application must be scalable
• Transactions must ensure data integrity
• The application will have a variety of clients
Type
• Session (stateful/stateless)
• Message-Driven
• Asyncronous
Persistence
ORM
• provides an object/relational mapping
facility to developers for managing
relational data in applications.
o The query language
 Finding Entities
 Persisting Entity Instances
o Object/relational mapping metadata
 Entities, Multiplicity, One-to-one, One-to-many,
Many-to-one, Many-to-many
 Cascade Deletes
Services
Authentication
• Sucurity
o Initial Authentication
o URL Authorization
o Invoking Business Methods (remotly)
• Realms,Users,Groups, and Roles
o LDAP or DB
• SSL and Certificates
JMS
Asynchronous Messagges
• Allows applications to create, send, receive, and read messages using reliable,
asynchronous, loosely coupled communication.
• Messaging is a method of communication between software components or
applications. A messaging system is a peer-to-peer facility: A messaging client
can send messages to, and receive messages from, any other client. Each client
connects to a messaging agent that provides facilities for creating, sending,
receiving, and reading messages.
• Messaging enables distributed communication that is loosely coupled. A
component sends a message to a destination, and the recipient can retrieve the
message from the destination.
• Asynchronous:
provider can deliver messages to a client as they arrive; a client does not have to
request messages in order to receive them.
• Reliable:
can ensure that a message is delivered once and only once. Lower levels of
reliability are available for applications that can afford to miss messages or to
receive duplicate messages.
Transactions
• A typical enterprise application accesses
and stores information in one or more
databases.
o TransactionTimeouts
o Updating Multiple Databases
Reset Enterprise (DEVEL)
• Web
• WebServices
• Remote Invocation
• Distribuite Task
• Messaging
• Pooling
• Transaction
• Security
Reset Enterprise (DEVEL)
Keep It Simple Stupid
• Web
• WebServices
• Remote Invocation
• Distribuite Task
• Messaging
• Pooling
• Transaction
• Security
• django / web2py / ecc..
• SOAPpy / jsonrcp
• PyRo / RPyC
• Celery / wh y prefer?
• Stomp / JMS Bridge
• What's you need?
• PEP: 249
• django / pattern / mind
It's python!
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Why people ask for Struts or JSF
Programmers?
• Because they want:
• XML programming
• No simple URL mappings (is XML not RE)
• @nnotations with no logic inside
• S****d Beans with getter and setter
• the validation written in XML
• Some complex container to inject A->B
• An enterprise language...
• Easy deploy: any fool can do this!
Packaging, Distributions,
Deployments
• egg
• setuptools
• easy_install
• mod_wsgi
• mod_python
• apache restart
Interview
When develop an enterprise
application?
• High number of users
• Distribuite Applications
• Transactional
• Clustering
o High Reliability
o Faul Tolerance
• Load Balancing (plugin)
o Stiky sessions
Scalability, Accessibility, and
Manageability
Scalability, Accessibility, and
Manageability
Scalability, Accessibility, and
Manageability
Enterprise Performance
Management
Just an open point....
monitoring applications
in production...
Java
• Wily Introscope
• Dynatrace
• JXInsight
Python
?
Questions?
s.federici@gmail.com

More Related Content

Viewers also liked

Django Mini Tutorial
Django Mini TutorialDjango Mini Tutorial
Django Mini Tutorial
Fahri Firdausillah
 
Coaching for Continuous Improvement
Coaching for Continuous ImprovementCoaching for Continuous Improvement
Coaching for Continuous Improvement
Hank Czarnecki
 
Next Target Condition Kata
Next Target Condition KataNext Target Condition Kata
Next Target Condition Kata
Beth Carrington
 
Something for your mind, your body and your soul!
Something for your mind, your body and your soul!Something for your mind, your body and your soul!
Something for your mind, your body and your soul!
peter decuypere
 
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
DesignBloggersConference
 
Kanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban EssentialsKanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban Essentials
Michael Sahota
 
Geschäftsmodelle Im Internet
Geschäftsmodelle Im InternetGeschäftsmodelle Im Internet
Geschäftsmodelle Im Internet
ADTELLIGENCE GmbH
 
Pressure In Solids
Pressure In Solids Pressure In Solids
Pressure In Solids
themathwhiz200
 
Toyota Kata Puzzle Experience Workshop
Toyota Kata Puzzle Experience WorkshopToyota Kata Puzzle Experience Workshop
Toyota Kata Puzzle Experience Workshop
Håkan Forss
 
How to improve flow efficiency, remove the red bricks Agile2014
How to improve flow efficiency, remove the red bricks Agile2014How to improve flow efficiency, remove the red bricks Agile2014
How to improve flow efficiency, remove the red bricks Agile2014
Håkan Forss
 
Lean Supermarket - Visual Management - November 2016
Lean Supermarket - Visual Management - November 2016Lean Supermarket - Visual Management - November 2016
Lean Supermarket - Visual Management - November 2016
W3 Group Canada Inc.
 

Viewers also liked (11)

Django Mini Tutorial
Django Mini TutorialDjango Mini Tutorial
Django Mini Tutorial
 
Coaching for Continuous Improvement
Coaching for Continuous ImprovementCoaching for Continuous Improvement
Coaching for Continuous Improvement
 
Next Target Condition Kata
Next Target Condition KataNext Target Condition Kata
Next Target Condition Kata
 
Something for your mind, your body and your soul!
Something for your mind, your body and your soul!Something for your mind, your body and your soul!
Something for your mind, your body and your soul!
 
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
WordPress and Google Analytics: Websites, Blogs, and Analytics Made Simple(r)...
 
Kanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban EssentialsKanban 101 - 3 - Kanban Essentials
Kanban 101 - 3 - Kanban Essentials
 
Geschäftsmodelle Im Internet
Geschäftsmodelle Im InternetGeschäftsmodelle Im Internet
Geschäftsmodelle Im Internet
 
Pressure In Solids
Pressure In Solids Pressure In Solids
Pressure In Solids
 
Toyota Kata Puzzle Experience Workshop
Toyota Kata Puzzle Experience WorkshopToyota Kata Puzzle Experience Workshop
Toyota Kata Puzzle Experience Workshop
 
How to improve flow efficiency, remove the red bricks Agile2014
How to improve flow efficiency, remove the red bricks Agile2014How to improve flow efficiency, remove the red bricks Agile2014
How to improve flow efficiency, remove the red bricks Agile2014
 
Lean Supermarket - Visual Management - November 2016
Lean Supermarket - Visual Management - November 2016Lean Supermarket - Visual Management - November 2016
Lean Supermarket - Visual Management - November 2016
 

Similar to Django in enterprise world

Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
NVISIA
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolith
Markus Eisele
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
Johan Edstrom
 
初探 OpenTelemetry - 蒐集遙測數據的新標準
初探 OpenTelemetry - 蒐集遙測數據的新標準初探 OpenTelemetry - 蒐集遙測數據的新標準
初探 OpenTelemetry - 蒐集遙測數據的新標準
Marcus Tung
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
Jonas Brømsø
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
rajmundr
 
Generating docs from APIs
Generating docs from APIsGenerating docs from APIs
Generating docs from APIs
jamiehannaford
 
Python enterprise vento di liberta
Python enterprise vento di libertaPython enterprise vento di liberta
Python enterprise vento di liberta
Simone Federici
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Vincenzo Barone
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
Marco Parenzan
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
Jussi Pohjolainen
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
jhugg
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development
Shean McManus
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Calvin Tan
 
Modernizing Applications with Microservices
Modernizing Applications with MicroservicesModernizing Applications with Microservices
Modernizing Applications with Microservices
Markus Eisele
 
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jRobotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Kevin Watters
 
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
Lucidworks
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Observability in real time at scale
Observability in real time at scaleObservability in real time at scale
Observability in real time at scale
Balvinder Hira
 

Similar to Django in enterprise world (20)

Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolith
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
初探 OpenTelemetry - 蒐集遙測數據的新標準
初探 OpenTelemetry - 蒐集遙測數據的新標準初探 OpenTelemetry - 蒐集遙測數據的新標準
初探 OpenTelemetry - 蒐集遙測數據的新標準
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
 
Generating docs from APIs
Generating docs from APIsGenerating docs from APIs
Generating docs from APIs
 
Python enterprise vento di liberta
Python enterprise vento di libertaPython enterprise vento di liberta
Python enterprise vento di liberta
 
Dev381.Pp
Dev381.PpDev381.Pp
Dev381.Pp
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ Novell
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
 
Modernizing Applications with Microservices
Modernizing Applications with MicroservicesModernizing Applications with Microservices
Modernizing Applications with Microservices
 
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jRobotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
 
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Observability in real time at scale
Observability in real time at scaleObservability in real time at scale
Observability in real time at scale
 

More from Simone Federici

Fabric Python Lib
Fabric Python LibFabric Python Lib
Fabric Python Lib
Simone Federici
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
Simone Federici
 
What is kanban
What is kanbanWhat is kanban
What is kanban
Simone Federici
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricks
Simone Federici
 
Java o non java
Java o non javaJava o non java
Java o non java
Simone Federici
 
Anti pattern se lo conosci lo eviti
Anti pattern se lo conosci lo evitiAnti pattern se lo conosci lo eviti
Anti pattern se lo conosci lo eviti
Simone Federici
 
Java VS Python
Java VS PythonJava VS Python
Java VS Python
Simone Federici
 
Django per non credenti
Django per non credentiDjango per non credenti
Django per non credenti
Simone Federici
 
Terracotta Torino Javaday
Terracotta Torino JavadayTerracotta Torino Javaday
Terracotta Torino JavadaySimone Federici
 
Terracotta Springmeeting
Terracotta SpringmeetingTerracotta Springmeeting
Terracotta SpringmeetingSimone Federici
 
Javaday Performance 2009
Javaday Performance 2009Javaday Performance 2009
Javaday Performance 2009
Simone Federici
 

More from Simone Federici (15)

Fabric Python Lib
Fabric Python LibFabric Python Lib
Fabric Python Lib
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
What is kanban
What is kanbanWhat is kanban
What is kanban
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricks
 
Java o non java
Java o non javaJava o non java
Java o non java
 
Anti pattern se lo conosci lo eviti
Anti pattern se lo conosci lo evitiAnti pattern se lo conosci lo eviti
Anti pattern se lo conosci lo eviti
 
Java VS Python
Java VS PythonJava VS Python
Java VS Python
 
Django per non credenti
Django per non credentiDjango per non credenti
Django per non credenti
 
Opensource Aziende
Opensource AziendeOpensource Aziende
Opensource Aziende
 
Maven Eclipse
Maven EclipseMaven Eclipse
Maven Eclipse
 
Terracotta Torino Javaday
Terracotta Torino JavadayTerracotta Torino Javaday
Terracotta Torino Javaday
 
Jipday Portletjsr168
Jipday Portletjsr168Jipday Portletjsr168
Jipday Portletjsr168
 
Spring20 Javaday
Spring20 JavadaySpring20 Javaday
Spring20 Javaday
 
Terracotta Springmeeting
Terracotta SpringmeetingTerracotta Springmeeting
Terracotta Springmeeting
 
Javaday Performance 2009
Javaday Performance 2009Javaday Performance 2009
Javaday Performance 2009
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 

Django in enterprise world

  • 1. Django in Enterprise World PyCon4 9 May, 2010 Simone Federici s.federici@gmail.com
  • 2. Obiettivo Django è sulla bocca di tutti, è un full stack framework che ha messo una pietra di storia nel mondo python, e non solo.  Ma perchè, in Italia, le grandi aziende per il web non riescono a uscire dal tunnel J2EE/JSF o, peggio, Struts? In questo talk porto alla luce differenze sostanziali di approccio alle problematiche comuni di applicazioni web, e ad architetture più complesse Enterprise. Ma cosa significa Enterprise? Tutto ciò che i clienti definiscono Enterprise lo è veramente? Come javista che pythonista, parlerò di cosa il mondo java rimprovera al mondo python e come ho scoperto che le accuse fanno acqua...
  • 3. Agenda • Mini Django Overview (ma dovreste già conoscerlo) • Enterprise World o Multi Tiers (client, web, business, EIS) o Conteiners, WebServices (SOA) o Transactions • Development • Deployments • Scalability, Accessibility, and Manageability • Q?
  • 4. Django mini overview (1) class Reporter(models.Model): full_name = models.CharField(max_length=70) def __unicode__(self): return self.full_name class Article(models.Model): pub_date = models.DateTimeField() headline = models.CharField(max_length=200) content = models.TextField() reporter = odels.ForeignKey(Reporter) def __unicode__(self): return self.headline manage.py syncdb from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^articles/(d{4})/$', 'mysite.views.year_archive'), (r'^articles/(d{4})/(d{2})/$', 'mysite.views.month_archive'), (r'^articles/(d{4})/(d{2})/(d+)/$', 'mysite.views.article_detail'), ) import models from django.contrib import admin admin.site.register(models.Article)
  • 5. Django mini overview (2) def year_archive(request, year): a_list = Article.objects.filter(pub_date__year=year) return render_to_response('news/year_archive.html', {'year': year, 'article_list': a_list}) {% extends "base.html" %} {% block title %}Articles for {{ year }}{% endblock %} {% block content %} <h1>Articles for {{ year }}</h1> {% for article in article_list %} <p>{{ article.headline }}</p> <p>By {{ article.reporter.full_name }}</p> <p>Published {{ article.pub_date|date:"F j, Y" }}</p> {% endfor %} {% endblock %}
  • 6. Django mini overview (4) from django.forms import ModelForm class ArticleForm(ModelForm): class Meta: model = Article exclude = ('title',) ArticleForm(request.POST).save() ArticleForm(instance=Article.objects.get(pk=1)).save() ArticleForm(request.POST, instance=Article.objects.get(pk=pk)).save() <form action="/form/" method="post"> {{ form.as_p }} <input type="submit" value="Submit" /> </form>
  • 7. Django mini overview (4) Authentication backends Middleware Validators Commands Custom model fields Custom template tags Custom template filters Custom storage system PDF, CVS, JSON, XML Jython Deploying Legacy database Error reporting via e-mail Initial data Managing files Testing Django applications Django’s cache framework Conditional View Processing Sending e-mail Internationalization and localization Pagination Serializing Django objects Django settings Signals A lot of pluggable applications... South (Data and DDL migrations)
  • 8. New Django 1.2 Features • Model Validation • Multi Database
  • 9. Enterprise World Defines an architecture for implementing services as multitier applications that deliver the scalability, accessibility, and manageability needed by enterprise- level applications. Distributed multitiered application model
  • 10. • Web o browser o ajax o flash o flex • GUI • Batch • DB • Legacy • NO SQL • FTP • Remote • JMS! • Persistence Entities • Session Beans • Message- Driven Beans • Presentation-oriented o GET, o HEAD, o POST, o PUT, o DELETE • Service-oriented (WS) o XML-RPC o SOA o REST o JSON
  • 11. EE Containers Centralized Configuration • JNDI • Datasource e Connection Pool (DB tuning) • Mail Server (SMTP configuration) • Enterprise JavaBeans (EJB) container • Web container • Application client container • Applet container
  • 12. Web Tier Web Applications • Servlet • Filters • Session Listner • CustomTag • Locale • JSF (why?) Web Services • XML • SOAPTransport Protocol • WSDL Standard Format • UDDI and XML Standard Formats • Attachments • Authentication
  • 13. Business Tier Local and RemoteEnterprise bean is a server-side component that encapsulates the business logic of an application. For several reasons, enterprise beans simplify the development of large, distributed applications. • the bean developer can concentrate on solving business problems because the container is responsible for system-level services such as transaction management and security authorization. • the client developer can focus on the presentation of the client. The client developer does not have to code the routines that implement business rules or access databases. • because enterprise beans are portable components, the application assembler can build new applications from existing beans. When • The application must be scalable • Transactions must ensure data integrity • The application will have a variety of clients Type • Session (stateful/stateless) • Message-Driven • Asyncronous
  • 14. Persistence ORM • provides an object/relational mapping facility to developers for managing relational data in applications. o The query language  Finding Entities  Persisting Entity Instances o Object/relational mapping metadata  Entities, Multiplicity, One-to-one, One-to-many, Many-to-one, Many-to-many  Cascade Deletes
  • 15. Services Authentication • Sucurity o Initial Authentication o URL Authorization o Invoking Business Methods (remotly) • Realms,Users,Groups, and Roles o LDAP or DB • SSL and Certificates
  • 16. JMS Asynchronous Messagges • Allows applications to create, send, receive, and read messages using reliable, asynchronous, loosely coupled communication. • Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive messages from, any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages. • Messaging enables distributed communication that is loosely coupled. A component sends a message to a destination, and the recipient can retrieve the message from the destination. • Asynchronous: provider can deliver messages to a client as they arrive; a client does not have to request messages in order to receive them. • Reliable: can ensure that a message is delivered once and only once. Lower levels of reliability are available for applications that can afford to miss messages or to receive duplicate messages.
  • 17. Transactions • A typical enterprise application accesses and stores information in one or more databases. o TransactionTimeouts o Updating Multiple Databases
  • 18. Reset Enterprise (DEVEL) • Web • WebServices • Remote Invocation • Distribuite Task • Messaging • Pooling • Transaction • Security
  • 19. Reset Enterprise (DEVEL) Keep It Simple Stupid • Web • WebServices • Remote Invocation • Distribuite Task • Messaging • Pooling • Transaction • Security • django / web2py / ecc.. • SOAPpy / jsonrcp • PyRo / RPyC • Celery / wh y prefer? • Stomp / JMS Bridge • What's you need? • PEP: 249 • django / pattern / mind
  • 20. It's python! >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
  • 21. Why people ask for Struts or JSF Programmers? • Because they want: • XML programming • No simple URL mappings (is XML not RE) • @nnotations with no logic inside • S****d Beans with getter and setter • the validation written in XML • Some complex container to inject A->B • An enterprise language... • Easy deploy: any fool can do this!
  • 22. Packaging, Distributions, Deployments • egg • setuptools • easy_install • mod_wsgi • mod_python • apache restart
  • 23. Interview When develop an enterprise application? • High number of users • Distribuite Applications • Transactional • Clustering o High Reliability o Faul Tolerance • Load Balancing (plugin) o Stiky sessions
  • 27. Enterprise Performance Management Just an open point.... monitoring applications in production... Java • Wily Introscope • Dynatrace • JXInsight Python ?