"…mais ce serait peut-être l'une des plus grandes opportunités manquées de notre époque si le logiciel libre ne libérait rien d'autre que du code…"

Archive for the ‘Ironpython’ Category

Quelques articles sur des frameworks Web Python : Django, Pylons, Web2py, Repoze.bfg, Pyxer

Posted by patrick sur février 8, 2009

Sources:

  • http://plope.com/whats_your_web_framework_doing (‘It can be a bit useless to benchmark web application frameworks. When you’re commmitted to a particular framework, either it works or it doesn’t for your particular application; often raw speed is not really a concern. You’re probably not going to switch web frameworks in the middle of a project in order to get a 15% or even a 50% or 100% speed increase: you’ve got too much investment in the code that works under the framework to consider it. In my experience, very few people truly understand more than one web framework, and they tend to use that framework for everything even it it’s slightly less optimal for any specific task; this is because the « switching cost » to go to another one is so high. So benchmarks aren’t really all that interesting in the « real » web world; it all depends on context. But if you haven’t chosen a web framework yet (is there anyone?), or if you’re falling out of love with your current web framework and you’re considering using a different one, you might be able to learn something from profiling an application running under various frameworks nonetheless, even if you ignore the raw speed of the framework itself’Here are the results:
  • http://compoundthinking.com/blog/index.php/2009/02/04/wsgi-and-cooperation/ (‘…The point of all this is that the wider python web world is seeing a huge increase in cross-polination of ideas, of working together on projects, and sharing code across major frameworks from TurboGears to Zope, to Pylons. And at the core of all this is the WSGI specification. WSGI may not be pefect, but it’s still great, because it provides a defined way for web framework developers to work together. And, that coupled with the fact that we’re all pretty friendly people, and we all like each other and want to work together on things, has created a renasance of sorts in python web tools world…’)
  • http://code.google.com/p/pyxer/ (‘Yet another Python Framework! The goal of this project to make web development as easy as possible to enable the developer to start quickly with a new project. This project should be distributable via PasteDeploy for normal servers and for Google App Engine (GAE), without the need of using different technologies and approaches. The Pyxer Server is a very simple Python Web Framework that aims to makes starting a new project as easy as it can be. It still works respecting the MVC concept but the files can be mixed in one directory. For a high end solution you should maybe consider using Pylons, Django, TurboGears and similar. This work is inspired by http://pythonpaste.org/webob/do-it-yourself.htmlTechnical background. The Google App Engine (GAE) in version 1.1 offers a very restricted Python environment and the developer as to ship arround a lot of limitations. Pyxer helps on this point by providing solutions that also work together with the WSGI Framework Paste by Ian Bicking. This way you get the best from both sides: GAE and Paste. To achieve this, some other common third party tools are used like WebOb and VirtualEnv also by Ian Bicking. The templating s based on Genshi. .‘)
  • http://groups.google.com/group/comp.lang.python.announce/browse_thread/thread/09cfe8decd549127/1382cac331ce7805?show_docid=1382cac331ce7805 (‘web2py 1.56 is out, including a new web site with better documentation http://www.web2py.com.
    • New features Include:
      =================
      – Authentication
      – Authorization (Role Based Access Controller)
      – CRUD
      – portable url fetch function
      – portable geocoding function
      – PEP8 compliant
      – Python 2.5 and Python 2.6 compliant
      – Runs on Jython (although without db drivers)
      – Runs on IronPython (although without CSV, db drivers and internal
      web-server)
      – DAL shortcuts
      – SQLFORM has default image preview
      – new generic.html view
      – more examples and documentation
      – always backward compatible ‘)
  • http://kiznet.fr/blog/2008/11/21/django–python-cest-plus-fort-que-toi/ (‘Aujourd »hui, je vais vous présenter Django, « Le framework web pour les perfectionnistes sous pression » ! Avouez que c »est déjà pas mal comme slogan. Je vais parler ici de mon expérience personnelle d’amateur qui pratique l »informatique sur son temps libre. Donc tout ce que je peux raconter ici peut apparaître totalement FAUX à un expert en la matière, mais bon, faut bien se lancer un jour hein 🙂 …J’ai ensuite installé Django en lui même (ce qui se résume à télécharger la version en cours de développement puis créer 2-3 liens symboliques, du gâteau quoi), puis paramétrer mon httpd.conf (de même, processus très simple grâce à la très bonne documentation très bien traduite par David Larlet. Résultat, en partant de rien, un framework fonctionnel disponible en production en tout juste 5 petites minutesBienvenue dans le monde merveilleux de Django! 🙂 Pour tes accents, vérifie que tu as bien créé ta base MySQL avec le bon encodage. Il y a en fait deux encodages qui interviennent: celui de la base et celui de la connexion client. Tu peux mettre les deux en UTF-8. L’encodage de la base détermine comment ton texte est stocké physiquement sur le disque; si tu mets un encodage non-universel, alors certains caractères ne pourront être stockés. L’encodage de la connexion client détermine comment ton texte est transféré physiquement entre le serveur SQL et ton applicatif. Là aussi, il est important que l’encodage choisi soit capable de gérer les caractères de ton texte, mais il est également très important que l’applicatif et le serveur SQL soient d’accord sur cet encodage (c’est une erreur que je vois trop souvent sur des sites PHP). Normalement Django pose tout seul les bons encodages sur la connexion client, donc de ce point de vue là ce n’est probablement pas un souci pour toi. Mais fais gaffe à l’encodage de la base. ‘)
  • http://www.screeley.com/entries/2008/aug/21/enterprise-django/ (‘…If there’s one thing I love about Alfresco it would be webscripts. They make it easy to retrieve, create and modify content from a repository RESTfully. Webscripts are also very technology agnostic, you can put just about anything on top. We looked at Symphony, Ruby on Rails and Django, but because I have a hammer and everything looks like a nail, we went with Django. This might have been short sighted. The developer working on this django-jython project only got Django running on Jython in TomCat 4 days ago. It also doesn’t help that the client asked if we misspelled banjo in our presentation. Needless to say there will be a few challenges going forward. Tech Stuff: If you have an existing Django project it takes less than an hour to make the conversion. Before you get started you will need three things: Java 6, Tomcat(I am using 5.5) and the Postgres JDBC. The initial install directions are here and to create the WAR the docs are here. The only issue I ran into was a Java class version issue, which is why you need Java 6. ‘)

A voir:

  • http://wiki.python.org/moin/WebFrameworks
  • http://mdp.cti.depaul.edu/ (‘web2pyTM Enterprise Web Framework.Free and open source full-stack enterprise framework for agile development of fast, secure and portable database-driven web-based applications. Written and programmable in Python.Version 1.56.1 (2009-02-05 11:49:10) Created by Massimo Di Pierro. © 2007-2009. ‘)
  • http://en.wikipedia.org/wiki/Django_(web_framework)
  • http://www.django-fr.org/liens/ (‘La documentation officielle est complète mais ne suffit parfois pas à certaines spécificités, les liens présents sur cette page sont là pour combler ce manque. ‘)
  • http://plope.com/Members/chrism/repoze-bfg (‘…So, for the last few weeks (at the expense of much else), with a lot of help from Paul Everitt and Tres Seaver, I’ve been working on a new web framework. This framework is named (provisionally) repoze.bfg (« Big Fine Gun« ). It uses the Zope CA, and Zope interfaces, and a bunch of other Zope libraries, but doesn’t use the Z2 or Z3 publishers; it has its own publisher. It also does not use any form of Zope security; it implements its own security model. It has the same concept of views that Zope and Django have. Its development model is closer to Pylons’ or Django’s than it is to Zope’s. It uses the z3c.pt templating system, which is a reimplementation of ZPT, or you can also use XSL, or plug in whatever templating system you like really. It doesn’t assume any particular persistence mechanism; you provide your own (ZODB, relational, filesystem, etc); in a tip of the hat to Pylons, that’s considered an application decision. It depends heavily on a variety of Ian Bicking creations, including WebOb and Paste. It’s very small, currently clocking in at a little over 2000 lines of code, minus dependencies. That said, it does about what I want out of a web framework. It’s still in a pretty early stage, but it has definitely moved its way out of « toy » phase. We’ve managed to create several applications using the framework so far. The very first one was repoze.virginia , which is the application which serves up Repoze.org these days. It’s a simple file hierarchy publisher with slight dynamicism. The second one Paul wrote, and it’s named repoze.lxmlgraph , where he demonstrates how one might publish a website that was represented entirely by a single XML document. The third one is named repoze.cluegun , which is a port of Rocky Burt’s ClueBin application to repoze.bfg. That code runs the ClueGun website . Of the three, ClueGun is probably the most real-world app (albeit small). I’m sort of excited about it. It’s sort of like getting out of jail or something to be able to have your own web framework to write as you see fit. We’ll likely continue to develop applications using repoze.bfg, pushing features into the framework as we find them useful.’)
  • http://en.wikipedia.org/wiki/Pylons_(web_framework)
  • http://static.repoze.org/bfgdocs/ (‘repoze.bfg is a Python web application framework. It is inspired by Zope, and uses Zope libraries to do much of its work. However, it is simpler than any released version of Zope. repoze.bfg uses the WSGI protocol to handle request and responses.’)
    • http://static.repoze.org/bfgdocs/narr/introduction.html#similarities-to-other-frameworks (‘The repoze.bfg concept of traversal is inspired by Zope. Additionally, repoze.bfg uses the Zope Component Architecture (“CA”) internally, as do Zope 2, Zope 3, and Grok. Application repoze.bfg developers use either ZCML (an XML dialect, used in Zope) or decorators to perform various configuration tasks. The decorator support is provided by the Grok project. Like Pylons, repoze.bfg is mostly policy-free. It makes no assertions about which database you should use, and its built-in templating facilities are only for convenience. In essence, it only supplies a mechanism to map URLs to view code, along with a convention for calling those views. You are free to use third-party components in your application that fit your needs. Also like Pylons, repoze.bfg is heavily dependent on WSGI.The “Django docs state that Django is an “MTV” framework in their FAQ. This also happens to be true for repoze.bfg:‘)
    • http://static.repoze.org/bfgdocs/narr/introduction.html#differences-from-other-frameworks (‘ Like Zope, the repoze.bfg framework imposes slightly more control inversion upon application developers than other Python frameworks such as Pylons. For example repoze.bfg assumes that you’re wiling to resolve a URL to a context object before passing it to a view. Pylons and other Python “MVC” frameworks have no such intermediate step; they resolve a URL directly to a controller. Another example: using the repoze.bfg security subsystem assumes that you’re willing to attach an ACL to a context object; the ACL is checked by the framework itself instead of by user code, and access is permitted or denied by the framework itself rather than by user code. Such a task would typically be performed by user-space decorators in other Python web frameworks. Unlike application development using Zope, application developers don’t interact with the Zope Component Architecture (“CA”) very much during repoze.bfg application development. Instead, the repoze.bfg framework tends to “hide” most interaction with the CA behind special-purpose API functions. Also unlike Zope and unlike other “full-featured” frameworks such as Django, repoze.bfg makes no assumptions about what persistence mechanisms you want to use to build an application. Zope applications are typically reliant on ZODB; repoze.bfg allows you to build ZODB applications, but it has no reliance on the ZODB package. Likewise, Django tends to make the assumption that you’re going to want to store your application’s data in a relational database. repoze.bfg makes no such assumption; it allows you to use a relational database but doesn’t enourage or discourage an application developer about such a decision.’)
  • http://en.wikipedia.org/wiki/Grok_(web_framework) (‘ Grok is a web framework based on Zope 3 technology. The project was started in 2006 by a number of Zope 3 developers.Grok has since then seen regular releases. Its core technologies (Martian, grokcore.component) are also finding uptake in other Zope 3 and Zope 2 based projects. The primary motive behind Grok is to make the powerful, but not quite easily approachable Zope 3 technology more accessible and easier to use for newcomers and, at the same time, speed up application development, in accordance with the agile programming paradigm.To achieve this, Grok gives up some Zope 3 principles. Instead of using a strictly explicit, XML based configuration language (ZCML) like Zope 3 does, Grok uses Python code for component configuration, and has many implicit defaults and conventions so that you don’t have to have so much configuration, in the hope that it is easier to learn than standard Zope 3. Grok aims to be more similar in feel to popular Python web frameworks like TurboGears, Pylons and Django, while at the same time it retains much of Zope 3’s codebase and its component approach to development. ‘)
Publicités

Posted in 2009, Ironpython, jython, package_management, python, Python Web Frameworks | Tagué: , , , , , | Leave a Comment »

Python: news du 17 décembre 2008

Posted by patrick sur décembre 18, 2008

  • http://tarekziade.wordpress.com/2008/12/16/pycon-2009-talks/ (‘The talks that made it:
    • How AlterWay releases web applications using zc.buildout
    • On the importance of PyPI in delivering and building Python softwares – mirroring, fail-over and third-party package indexes »)
  • http://jessenoller.com/2008/12/16/pycon-2009-talks-accepted/ (‘Last night I got two emails – both of my talks I proposed for PyCon 2009 were accepted, here’s the title and abstract from both:
    • Introduction to Multiprocessing in Python
      • This talk will cover the new multiprocessing package included with Python 2.6 (and 3.0) focusing on design, benefits, practical usage, application construction, gotchas and how to use it to build multi-core and distributed applications.
    • Concurrency and Distributed Computing with Python Today
      • This talk will cover the recent changes to Python 2.6, including a brief introduction to the threading module and multiprocessing inclusion and changes but will primarily focus on the concurrent and distributed ecosystem for Python today.‘)

Posted in 2008, DotNet, Ironpython, Multiprocessing, package_management, python | Tagué: | Leave a Comment »

Quelques nouvelles de python: cobra, fusil, django

Posted by patrick sur février 12, 2008

http://www.blueskyonmars.com/2008/02/08/cobra-programming-language/ ( » So, we’ve got Jython and IronPython as Python language reimplementations. There’s also Boo, which is clearly heavily inspired by Python but has some interesting extensions (static typing, for example). I just came across Cobra (http://cobra-language.com/). Cobra, like Boo, is built on the .NET platform. The syntax is clearly inspired by Python, which I consider a good thing. In keeping line noise to a minimum, Cobra even ditches the “:” at the end of the line preceding a block of code. Chuck Esterbrook has also pulled inspiration from a number of other places. I recognize some D and Eiffel in there (it’s got design by contract and unit tests built right into the classes). There’s a comparison to Python available right on the Cobra site. »)

http://www.haypocalc.com/blog/index.php/2008/01/04/112-fusil-version-07 (« L’idée de Fusil est de simplifier l’écriture d’un projet de fuzzing. Il suffit de décrire le scénario pour préparer et surveiller l’environnement, sans avoir à s’occuper des détails techniques (rediriger la sortie du processus, détecter un plantage, etc)« )

http://www.voidspace.org.uk/python/weblog/arch_d7_2008_01_26.shtml#e930 (« This is an early announcement of a new project: Python-System, an implementation of the BCL and other .NET libraries in pure Python. Before you decide I’m completely mad, let me explain my motivation. Smile

The goal here is to provide libraries (the BCL and other .NET libraries) to aid the porting of IronPython code to run on CPython. Specifically, I would like to get Resolver One spreadsheets, exported as code, to run under CPython. I’m opening it up because it may also be useful to other people, and maybe you’ll help me. Laughing

I will be starting with partial implementations of Array, DateTime, Color, Point and friends (the ‘low hanging fruit’). The goal is for ‘compatible but not necessarily complete’ implementations of the classes (etc) that I need. Code that is useful for other people will happily be added of course.« )

http://blog.michaeltrier.com/2008/2/11/this-week-in-django-10-2008-02-10 (« This week we talk about a few source commits, a discussion about unicode usernames, Some cool projects from the community, the Tip of the Week, and a couple of questions from the IRC. »)

http://www.djangoproject.com/weblog/2007/dec/16/book/ («  The Django Book started shipping last week, and we’ve put the full text online for free. We put a draft of the book up about a year ago for comments, and were amazed by the quality (and quantity!) of responses. We read each of the comments (around 2500) as we revised the book towards a final print release. That print release has been available in stores for about a week, and we’ve put the text up for you to read for free. »)

http://www.holovaty.com/blog/archive/2007/12/12/1311 (« …Now that the Django Book is finally in the can, I’m mulling the idea of writing another book — this time, a book about online journalism. In the past two years, I’ve been to (way too) many journalism-related events and conferences trying to spread the good word about « journalism via computer programming, » and I’ve detected a strong, I daresay furious, demand, from journalists at all levels in the org chart, for information about this new form of journalism. Higher-ups want to know why they should employ programmers; middle managers want to know how to find them and how to treat them; and working journalists want to learn these skills and strategies. The problem is that I can’t point them anywhere for in-depth information. This book would attempt to solve that. I want to take a shot at writing a manual, a manifesto, a practical guidebook to this emerging discipline of database-driven Web journalism. It would be a combination of high-level strategy and low-level technique, probably split cleanly into two parts (one for the suits, one for the non-suits). »)

http://www.biologeek.com/journal/index.php/astuces-et-bonnes-pratiques-django (« Développant avec Django depuis maintenant près de deux ans (ça rajeunit pas tout ça…), je suis encore surpris de découvrir de nouvelles possibilités de temps en temps. Dans mon combat pour les bonnes pratiques, je pense qu’il y a quelques bases à avoir pour se lancer dans un projet d’envergure avec Django. Je vais essayer de lister les miennes, n’hésitez pas à ajouter les vôtres pour que ça devienne une ressource collaborative…)

Posted in DotNet, Ironpython, python, tests | Tagué: , , | Leave a Comment »

Nouvelles de python pour la semaine du 14 au 20 janvier 2008

Posted by patrick sur janvier 21, 2008

En vrac, quelques nouvelles de python

================================
http://highscalability.com/youtube-architecture (« – encore sur la liste Tutor, on apprend que YouTube emploie Python: YouTube grew incredibly fast, to over 100 million video views per day, with only a handful of people responsible for scaling the site. How did they manage to deliver all that video to all those users? And how have they evolved since being acquired by Google?

Information Sources

  • Google Video

    Platform

  • Apache
  • Python
  • Linux (SuSe)
  • MySQL
  • psyco, a dynamic python->C compiler
  • lighttpd for video instead of Apache

    What’s Inside?

    The Stats

  • Supports the delivery of over 100 million videos per day.
  • Founded 2/2005
  • 3/2006 30 million video views/day
  • 7/2006 100 million video views/day
  • 2 sysadmins, 2 scalability software architects
  • 2 feature developers, 2 network engineers, 1 DBA
  • Web Servers

  • NetScalar is used for load balancing and caching static content.
  • Run Apache with mod_fast_cgi.
  • Requests are routed for handling by a Python application server.
  • Application server talks to various databases and other informations sources to get all the data and formats the html page.
  • Can usually scale web tier by adding more machines.
  • The Python web code is usually NOT the bottleneck, it spends most of its time blocked on RPCs.
  • Python allows rapid flexible development and deployment. This is critical given the competition they face.
  • Usually less than 100 ms page service times.
  • Use psyco, a dynamic python->C compiler that uses a JIT compiler approach to optimize inner loops.
  • For high CPU intensive activities like encryption, they use C extensions.
  • Some pre-generated cached HTML for expensive to render blocks.
  • Row level caching in the database.
  • Fully formed Python objects are cached.
  • Some data are calculated and sent to each application so the values are cached in local memory. This is an underused strategy. The fastest cache is in your application server and it doesn’t take much time to send precalculated data to all your servers. Just have an agent that watches for changes, precalculates, and sends….)
  • =============================
    http://www.oreillynet.com/onlamp/blog/2008/01/pymotw_threading.html (« Doug Hellman’s Python Module of the Week is all about threading. »)

    http://www.python.org/dev/peps/pep-0369/ (« This PEP proposes enhancements for the import machinery to add post import hooks. It is intended primarily to support the wider use of abstract base classes that is expected in Python 3.0.The PEP originally started as a combined PEP for lazy imports and post import hooks. After some discussion on the python-dev mailing list the PEP was parted in two separate PEPs « )

    http://www.python.org/dev/peps/pep-3119/ (… Abstract This is a proposal to add Abstract Base Class (ABC) support to Python 3000. It proposes:

    • A way to overload isinstance() and issubclass().
    • A new module abc which serves as an « ABC support framework ». It defines a metaclass for use with ABCs and a decorator that can be used to define abstract methods.
    • Specific ABCs for containers and iterators, to be added to the collections module.

    Much of the thinking that went into the proposal is not about the specific mechanism of ABCs, as contrasted with Interfaces or Generic Functions (GFs), but about clarifying philosophical issues like « what makes a set », « what makes a mapping » and « what makes a sequence ». There’s also a companion PEP 3141, which defines ABCs for numeric types. Acknowledgements Talin wrote the Rationale below [1] as well as most of the section on ABCs vs. Interfaces. For that alone he deserves co-authorship. The rest of the PEP uses « I » referring to the first author. In the domain of object-oriented programming, the usage patterns for interacting with an object can be divided into two basic categories, which are ‘invocation’ and ‘inspection’. Invocation means interacting with an object by invoking its methods. Usually this is combined with polymorphism, so that invoking a given method may run different code depending on the type of an object. Inspection means the ability for external code (outside of the object’s methods) to examine the type or properties of that object, and make decisions on how to treat that object based on that informationone of the criticisms of inspection by classic OOP theorists is the lack of formalisms and the ad hoc nature of what is being inspected. In a language such as Python, in which almost any aspect of an object can be reflected and directly accessed by external code, there are many different ways to test whether an object conforms to a particular protocol or not. For example, if asking ‘is this object a mutable sequence container?’, one can look for a base class of ‘list’, or one can look for a method named ‘__getitem__’. But note that although these tests may seem obvious, neither of them are correct, as one generates false negatives, and the other false positivesThis PEP proposes a particular strategy for organizing these tests known as Abstract Base Classes, or ABC. ABCs are simply Python classes that are added into an object’s inheritance tree to signal certain features of that object to an external inspector. Tests are done using isinstance(), and the presence of a particular ABC means that the test has passed…Specification The specification follows the categories listed in the abstract:

    • A way to overload isinstance() and issubclass().
    • A new module abc which serves as an « ABC support framework ». It defines a metaclass for use with ABCs and a decorator that can be used to define abstract methods.
    • Specific ABCs for containers and iterators, to be added to the collections module. »)

    http://www.webfaction.com/demos/django (« How to install a real-life Django application on our servers. Watch Demo« )

    http://www.vulnerabilite.com/securite-open-source-audit-faille-coverity-actualite-20080110223332.html (« Doté d’une enveloppe initiale de 300 000 dollars, le programme Open Source Hardening Project a été lancé en mars 2006 avec pour mécène le département américain de la sécurité intérieure ( DHS ). Ce programme dont la conduite a été confiée à l’Université de Standford et à la société Coverity, a pour objectif de passer au crible le code de plusieurs logiciels open source (écrits en C et C++) parmi les plus populaires afin d’identifier les failles présentes, et ainsi contribuer au renforcement de leur sécurité... La société basée à San Francisco a par ailleurs défini plusieurs niveaux dans le processus de correction de bugs, soit 3 au total et a annoncé mardi que 11 projets open source ont atteint le niveau le plus élevé ( Rung 2 ). En raison des efforts fournis pour assurer de façon proactive l’intégrité et la sécurité des applications développées, Coverity indique que les entreprises et particuliers peuvent choisir avec encore plus de confiance les logiciels open source suivants : Amanda, NTP, OpenPAM, OpenVPN, Overdose, Perl, PHP, Postfix, Python, Samba et TCL... Si tous les logiciels contrôles ne peuvent pas encore prétendre au Rung 2, certains le pourront dans les prochains mois mais en attendant, Firefox ou encore Apache restent cantonnés au Rung 1 (86 projets), voire au Rung 0 (173 projets) comme nmap ce qui signifie que les bugs détectés n’ont pas encore été corrigés« )

    http://holdenweb.blogspot.com/2008/01/resolver-released.html (« In yet another piece of good news for Python fans, Resolver Systems have released their first product. It’s a spreadsheet that you can manipulate in Python, and it’s received a lot of interest from the financial communities on both sides of the Atlantic. [You would not believe how much of the world’s financial dealing is controlled and managed by spreadsheets; it’s really quite scary]. Resolver One is written in IronPython by a team which includes the Fuzzyman (occasionally also known as Michael Foord), of Voidspace Techie Blog fame, and it’s currently the largest product developed in that languages, with a total codebase (including tests) of over 100 kloc. The company is bravely making the product available (though not, I believe, as open source) free for non-commercial use.« )

    Posted in 2008, Ironpython, python, Web applications, Web Frameworks | Tagué: , , , , , | Leave a Comment »

    Quelques nouvelles de python: Django, Python 3000, Ironpython, Zope/Plone

    Posted by patrick sur décembre 17, 2007

    Quelques nouvelles du monde python

    • django
    • python 3.0
    • zope/plone
    • ironpython

    Django:

    http://www.holovaty.com/blog/archive/2007/12/12/1311(« It’s here! At long last, the print copy of the Django Book has shipped. I received my author copies late last week and am still poking at them to make sure that, yes, a tangible book with my name on the cover has actually been printed, on real paper, by a real publisher. Now that the Django Book is finally in the can, I’m mulling the idea of writing another book — this time, a book about online journalism. In the past two years, I’ve been to (way too) many journalism-related events and conferences trying to spread the good word about « journalism via computer programming, » and I’ve detected a strong, I daresay furious, demand, from journalists at all levels in the org chart, for information about this new form of journalism. Higher-ups want to know why I want to take a shot at writing a manual, a manifesto, a practical guidebook to this emerging discipline of database-driven Web journalism. It would be a combination of high-level strategy and low-level technique, probably split cleanly into two parts (one for the suits, one for the non-suits) they should employ programmers; middle managers want to know how to find them and how to treat them; and working journalists want to learn these skills and strategies. The problem is that I can’t point them anywhere for in-depth information. This book would attempt to solve that. . »)

    Python 3.0

    • http://www.artima.com/weblogs/viewpost.jsp?thread=220341 (« This is just a quick post to let everyone know that Python 3.0a2 is released as of 10:30am PST (18:30 UTC) today (Friday December 7, 2007). I’m grateful to the many people who have contributed to this release, in particular new core developers Christian Heimes and Amaury Forgeot d’Arc.GHOP contestants who contributed documentation updates, and to Georg Brandl for collecting these and submitting them to Subversion. There are still many more tasks available! However, I do want to mention that based upon the feedback for 3.0a1, we’ve decided to make the ‘bytes’ type immutable, and create a separate mutable bytes type, ‘bytearray‘. These two types are mutually compatible, but in the majority of cases you’ll be using bytes, not bytearray. I should also note that we’ve run into an issue with the Windows installers — see the release page above. If anyone can help this, please write to python-dev at python.org. (The script that creates the installer is in the distribution as Tools/msi/msi.py.) And finally, a word of thanks to all the participants « )
    • http://simonwillison.net/2007/Dec/16/chapter/ (« Chapter 7: Form Processing. The chapter on newforms I contributed to “The Definitive Guide to Django” is now online, along with the rest of the published book. »)
    • http://www.lethain.com/entry/2007/dec/04/two-faced-django-part-1-building-project-exists-si/ (« This series of articles aims, in the clear step-by-step style of the Django tutorial, to take you through the process of building a Django application that exists as both a simple web application, and also as a Facebook application. The web and Facebook applications will store information in the same database, using the same models, and thus users of one interface will be able to interact with the other.« )
    • http://simonwillison.net/tags/python/ : un excellent recueil de nouvelles sur Django

    Zope, plone
    http://encolpe.wordpress.com/2007/12/02/archgenxml-et-le-futur-de-la-generation-de-code-sous-zopeplone/ (« ArchGenXML et le futur de la génération de code sous Zope/Plone. Cela faisait un bon moment que je n’avais pas écrit un billet ici… et pour cause: on temps libre est principalement occupé par le développement et les tests de la version 2.0 de ArchGenXML. Contrairement à la version 1.5 qui ciblait Plone 2.1avec une compatibilité Plone 2.5 cette version est construite autour du support de Plone 3.0 avec une compatibilité vers Plone 2.5…Les buts atteints de cette version sont le passage en egg de ce module, le support des profils Generic Setup , la génération des interfaces Zope3, la génération des tests unitaires et des tests fonctionnels en python et au format doctest. Des gros changement en perspective, et une incompatibilité avec la génération précédente. Nous restons bloqués en phase d’évaluation béta par manque testeurs. Nous cherchons en particulier des testeurs pour la partie génération de workflows…Du coté du futur de la génération de code, ArchGenXML génère déjà du code Zope 3 (pour son utilisaton dans Plone) et d’autres projets de CMS en python commencent à s’intéresser à cette possibilité (voir la branche Django)…L’autre nouveauté, plus contraignante celle-ci, est l’utilisation de nouveaux connecteurs dans les schémas UML pour symboliser les ‘adapter’. Les versions précédentes d’ArchGenXML se satisfaisaient d’éditeurs utilisant UML 1.4 et il faut à présent des éditeurs utilisant UML 2.0 au minimum pour cette nouvelle fonctionnalité. Exit donc les éditeurs tel que ArgoUML qui était le seul éditeur UML libre supportéPour l’instant nous allons continuer d’utiliser ArgoUML et Poseidon pour le développement des fonctionnalités d’ArchGenXML. En un mois j’ai testé umbrello, gaphor, Apollo pour eclipse et Papyrus. Papyrus est vraiment très intéressant et est développé au CEA. Mais cela reste une extension d’eclipse donc il faut faire du Java pour générer du Python… c’est un peu dommage.« )

    Ironpython

    http://www.voidspace.org.uk/python/weblog/arch_d7_2007_12_08.shtml#e899 (« the last few days I’ve been off work trying to get a chapter on Windows Presentation Foundation finished. I haven’t got as much of the writing as I would have liked done, but I have finished the research and completed two of the three examples. WPF is great for creating funky user interfaces, and comes with some great controls. Despite the emphasis on XAML it is also easy to use from code…More importantly, two more chapters of IronPython in Action are available in the Manning Early Access Program. I’m pretty proud of these chapters. Chapter 7 is on testing with IronPython (including functionally testing a GUI application) and chapter 8 is about deeper aspects of Python and interacting with the .NET framework. The information in section 8.4 is vital to any non-trivial interaction with .NET so I’m glad it has gone liveWPF FlowDocuments are cool by the way, very high level document viewing controls for very little effort – but another new markup to learn (a subset of XAML) to use them« )

    http://www.voidspace.org.uk/python/weblog/arch_d7_2007_12_08.shtml#e898 (…My talk is Python in your Browser with IronPython & Silverlight, the second one on the list!

    Silverlight is a new browser plugin from Microsoft. It is intended for media streaming, games and rich internet applications. It is cross-platform and cross-browser and comes with a rich programmers API.

    Through the Dynamic Language Runtime, Silverlight is fully programmable with IronPython – meaning that at last client side web applications can be written fully in Python. This talk will explore some of the things that you can do with IronPython in the browser.

    This includes making web apps run faster, writing ‘rich’ applications (or games), and embedding a Python interpreter into web pages for tutorials and documentation.

    It is a good year for IronPython talks (and so it should be). As well as my talk there are:

    • IronPython: The Road Ahead (48 – Jim Hugunin)
    • End-user computing without tears using Resolver, an IronPython spreadsheet (65 – Giles Thomas – the Resolver boss!)
    • Using .NET Libraries in CPython (103 – Mr. Feihong Hsu – a talk on Python.NET which definitely deserves more attention and is related to IronPython)

    There is also a talk by another Resolver developer (not on IronPython though):

    • Getting started with test-driven development (5 – Jonathan Hartley)

    It should be a great conference. Smile« )

    http://www.resolverhacks.net/ ( » Resolver is a powerful tool for collecting, handling and analysing ‘business data’. It inhabits the space somewhere between a traditional spreadsheet and a Rapid Application Development tool. With Resolver you can use the familiar spreadsheet interface to create applications, build powerful spreadsheets pulling in data from databases and financial data-streams, or implement business logic to be integrated into other IT systems. Its power and flexibility comes from the fact that it is fully programmable with Python code, using the .NET framework. This means that you can use just about any .NET or Python library within your spreadsheets. You can also easily develop libraries of functions and classes to be shared between your spreadsheets. Spreadsheets can be exported as code, enabling you to re-use business logic with other Python or .NET applications.Resolver has a few other novel features, like shared worksheets which can be editted simultaneously by multiple users on different machines. We’re sure that new and innovative uses for Resolver will develop, and hopefully this website will help uncover some of them! Resolver can import and export data from Excel, and there are interesting tricks for communicating with or even driving Excel. You can also reference cells inside an Excel spreadsheet from a Resolver spreadsheet.For a longer overview of the features of Resolver, read Resolver: What and Why?. »)

    http://www.voidspace.org.uk/python/weblog/arch_d7_2007_12_08.shtml#e897 (« The version released was 1.0 beta 4. This includes quite a few major changes since I last updated you about progress with Resolver. One of the major changes was that we made the API for working with spreadsheet objects simpler from user code. This was a lot of work, but I think it was worth it. The very worst side effect was that it broke most of my examples on the Resolver Hacks website. Today I have finally got around to updating it and putting new screenshots in (Resolver got prettier):

    There are around thirty pages of articles and examples to get you going with Resolver. Some of the most useful ones are:

    http://www.ironpython.info/index.php/Main_Page (« This wiki contains recipes and example code for IronPython. IronPython is a Microsoft port of the Python Programming Language to the .NET framework.

    Python is a dynamic language, used for a wide variety of purposes, with an emphasis on clean and expressive code. It allows the maximum flexibility for the developer, whilst maintaining readability of code.« )

    http://www.manning.com/foord/ («  IronPython in Action offers a comprehensive, hands-on introduction to Microsoft’s exciting new approach for programming the .NET framework. It approaches IronPython as a first class .NET language, fully integrated with the .NET environment, Visual Studio, and even the open-source Mono implementation. You’ll learn how IronPython can be embedded as a ready-made scripting language into C# and VB.NET programs, used for writing full applications or for web development with ASP. Even better, you’ll see how IronPython works in Silverlight for client-side web programming. IronPython opens up exciting new possibilities. Because it’s a dynamic language, it permits programming paradigms not easily available in VB and C#. In this book, authors Michael Foord and Christian Muirhead explore the world of functional programming, live introspection, dynamic typing and ‘duck typing’, metaprogramming, and more. IronPython in Action explores these topics with examples, making use of the Python interactive console to explore the .NET framework with live objects. The expert authors provide a complete introduction for programmers to both the Python language and the power of the .NET framework. The book also shows how to extend IronPython with C#, extending C# and VB.NET applications with Python, using IronPython with .NET 3.0 and Powershell, IronPython as a Windows scripting tool, and much more.« )

    http://ironpython-urls.blogspot.com/2007/12/mono-boo-python-gnome-ironpython.html (« Mono, Boo, Python, Gnome & IronPython. Miguel de Icaza has a blog entry responding to an article on ‘Mono Usage in the Enterprise’:

    It has some interesting comments on the role of Python in the Gnome project and IronPython and Boo on Mono: Python is indeed making great strides as a desktop development platform and am not sure that we are in the business of competing with it. If people like writing Python code, they should just keep writing python code. Myself, I like the IronPython variation of Python more. IronPython just happens to be JITed Python and in most tests it is faster than CPython. For the past year or so, we have also been in love with Boo, another .NET language. Boo has support for strong typing, so for certain scenarios you will get even better performing code (basically, when you can determine the type of a variable ahead of time, instead of having the variable be entierly late bound).« )


    Produits, bibliothèques Python

    http://wiki.secondlife.com/wiki/Eventlet (« Eventlet is a networking library written in Python. It achieves high scalability by using non-blocking io while at the same time retaining high programmer usability by using coroutines to make the non-blocking io operations appear blocking at the source code level.

    Eventlet runs on Python version 2.3 or greater, with the following dependenceis:

    • greenlet
    • (if running python versions < 2.4) a deque object in a collections module. One option is to copy this deque into a file called collections.py.


    Eventlet began life as Donovan Preston was talking to Bob Ippolito about coroutine-based non-blocking networking frameworks in Python. Most non-blocking frameworks require you to run the « main loop » in order to perform all network operations, but Donovan wondered if a library written using a trampolining style could get away with transparently running the main loop any time i/o was required, stopping the main loop once no more i/o was scheduled. Bob spent a few days during PyCon 2005 writing a proof-of-concept. He named it eventlet, after the coroutine implementation it used, greenlet. Donovan began using eventlet as a light-weight network library for his spare-time project Pavel, and also began writing some unittests.

    When Donovan started at Linden Lab in May of 2006, he added eventlet as an svn external in the indra/lib/python directory, to be a dependency of the yet-to-be-named backbone project (at the time, it was named restserv). However, including eventlet as an svn external meant that any time the externally hosted project had hosting issues, Linden developers were not able to perform svn updates. Thus, the eventlet source was imported into the linden source tree at the same location, and became a fork. Bob Ippolito has ceased working on eventlet and has stated his desire for Linden to take it’s fork forward to the open source world as « the » eventlet.« )

    http://www.artima.com/weblogs/viewpost.jsp?thread=217546 (« The Python Quick Reference has been the most excellent resource for many years, because it gives you an overview of the entire language and usually allows you to quickly find the solution you’re looking for. If it doesn’t, it has links directly into the Python documentation. Just so Richard Gruet and the others who work on the PQR know, you have lots of fans out there. Thanks for all your work…Before you fire up your comments, I continue to root for Ruby. I think it’s great that Sun is directly supporting it as the scripting language for the JVM (as far as I know none of the other languages are actually getting financial support). I am also attracted to the more dynamic features of the language like open classes and the like. As far as dynamic languages on the JVM, both Ruby and the upcoming new version of Jython seem to me to be the most attractive of the offerings.But to make Ruby easier, I suggest that Rubyists study from and plagiarize the PQR, and also learn from the « batteries included » approach in the Python standard libraries. Both of these are things that keep me going back to Python« )

    Posted in 2007, DotNet, Ironpython, python, RAD, RIA, Web applications | Tagué: , | Leave a Comment »

    Connexion entre composants Java et DotNet: Ikvm, boo, java, .NET, ironpython

    Posted by patrick sur décembre 15, 2007

    Source: http://ironpython-urls.blogspot.com/2007/11/boo-java-net-and-ironpython.html

    ————————————————-<————————————

    Thursday, November 15, 2007

    Boo, Java, .NET and IronPython

    A blogger called Tomo wondered about which .NET language to choose Boo (a mighty fine language) or IronPython. He came down in favour of Boo, and an interesting discussion ensued in the comments:

    The very next thing he tried was taking the Java class library for SWT (the user interface library) and compiled them into a .NET dll with IKVM. He then used them from Boo and IronPython, which worked!

    This is an interesting coincidence, as a few days ago Rodrigo announced on the Boo blog about boojay – a compiler that emits Java bytecode from Boo:

    ————————————————-8<———————————————

    Source: http://blogs.codehaus.org/people/bamboo/archives/001623_introducing_boojay.html
    (« A boo application using the SWT java GUI library. Thanks to IKVM that’s not only possible but very simple as well. So what’s the news? Well, Friday morning I was chatting with Klaus and he said to me « if you get boo to emit java bytecodes I’ll do all my stuff in boo ». How’s that for a challenge? 🙂 Thanks again to IKVM, ObjectWeb ASM and the extensible boo pipeline architecture boojay was born after a weekend of relaxed hacking « )

    http://boo-extensions.googlecode.com/svn/trunk/boojay/ (« boojay is an attempt at getting the boo compiler to emit java bytecode. Architecture
    Thanks to the amazing IKVM project it is possible to use the great ObjectWeb ASM library from boo running on mono/ms.net to emit native java bytecodes that can be executed by any compliant java virtual machine
    « )

    http://koans.tomo-online.com/2007/11/15/langage-frenzy/ (« Although I should be doing something else, Boo, IronPython and .NET kept occupying my mind. So I made a small coding experiment. First, I downloaded IKVM. Then – SWT. I compiled SWT jar to a dll. No problems here. Then I wrote a SWT hello world in IronPython. To be honest – I took a Java one from SWT website and rewrote line by line. I was surprised that my hello world ran without a glich! Next, I copied a HelloWorldSWT.py into HelloWorldSWT.boo and changed the import statement. Compiled (”By golly! No problems? No warnings?”) and run. And no problems again?? It started to look suspicious… Java run on .NET, calls from Java to native library, two different languages… and everything without a single warning? So I decided to take it to foreign territory… Ubuntu! I fired up a VMWare image with Ubuntu 6.10 (the linux vm I have handy), downloaded Linux SWT, compiled it to dll, copied HelloWorldSWT.exe from Windows along with some ikvm dlls and… no problems again! I’m really, really surprised how smooth the experiment was. Thumbs up! « )

    http://en.wikipedia.org/wiki/IKVM (« IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. IKVM is free software, distributed under a permissive free software licence. IKVM includes the following components: for

    • A Java Virtual Machine implemented in .NET
    • A .NET implementation of the Java class libraries
    • Tools that enable Java and .NET interoperability

    With IKVM you can run compiled Java code (bytecode) directly on Microsoft .NET or Mono. The bytecode is converted on the fly to CIL and executed. Jeroen Frijters is the main contributor to IKVM.NET. He is Technical Director of Sumatra Software, based in The Netherlands. As of June 2007, the machine supports Java 1.6 with the exception of AWT and Swing. IKVM uses OpenJDK as its class library. »)

    http://www.ikvm.net/ (« ..The following projects are related to IKVM.NET in some way:

    http://www.eclipse.org/swt/ (« SWT is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.« )

    http://www.gnu.org/software/classpath/classpath.html (« GNU Classpath, Essential Libraries for Java, is a GNU project to create free core class libraries for use with virtual machines and compilers for the java programming language. Classpath is still a work in progress. The first public release will be version 1.0. There have been no public releases; however, pre-release source code is available via GNU’s anonymous CVS server , and snapshots of the Classpath tree have been released and are available from ftp://ftp.gnu.org/gnu/classpath/« )

    http://en.wikipedia.org/wiki/GNU_Classpath (« GNU Classpath is a project aiming to create a free software implementation of the standard class libraryJava programming language. Despite the massive size of the library to be created, the majority of the task is already done, including Swing, CORBA, and other major parts. The Classpath developers have implemented almost all of the classes from J2SE 1.4 and 5.0. Classpath can thus be used to run popular Java-based software such as Azureus and Eclipse. It is a part of the Free Software Foundation‘s GNU project and was launched so that computer users could use Java programs without giving up the freedoms which the free software movement works to secure. GNU Classpath was originally developed in parallel with libgcj due to license incompatibilities, but later merged...Since version 0.95, Java 1.5 additions like generics have been fully integrated into the main branch. The branch allows GCJ to use Eclipse compiler, ecj, to compile Java 1.5 source code to bytecode, which is then changed into native code by GCJ itself« )

    http://en.wikipedia.org/wiki/Boo_programming_language (« Boo is an object oriented, statically typed programming language developed starting in 2003, which seeks to make use of the Common Language Infrastructure support for Unicode, internationalization and web style applications, while using a Python-inspired syntax and a special focus on language and compiler extensibility. Some features of note include type inference, generators, multimethods, optional duck typing, macros, true closures, currying, and first class functions. Boo is open sourcelicensed under an MIT/BSD style license.Boo can be used with Microsoft .NET or Mono. »)

    https://pvergain.wordpress.com/2007/08/17/grasshopper-faire-tourner-des-applications-aspnet-sur-des-serveurs-j2ee/
    (« Grasshopper 2.0 enables you to produce .NET Web and server applications that run on Linux & other Java-enabled platforms using ASP.NET 2.0 controls, role-based security, and C# generics. Check out our developer blogs, interop forums, code samples, and how-to articles to learn how« )

    – http://blog.mainsoft.com/blog/net-java-interop-8-links-to-get-you-started/(« 

    Posted in 2007, ASP.NET, Développement logiciel, DotNet, FSF, IDE-GUI, Ironpython, J2EE, java, JEE, python | Tagué: , , , | Leave a Comment »

    Les nouveautés dans ASP.NET Extensions: ASP.NET MVC et ASP.NET AJAX

    Posted by patrick sur décembre 15, 2007

    Comme le précise ce billet http://dosimple.ch/articles/MVC-ASP.NET/ écrit le 2 mai 2006 et celui-ci écrit le 13 mars 2007, le framework ASP.NET n’incite pas particulièrement à la séparation stricte de type Modèle, Vue, Contrôleur. On a vu que Monorail, projet open source, implémente le modèle MVC. Microsoft emboite le pas avec un grand retard en introduisant ASP.NET MVC: voir le billet suivant: http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx (« One of the things that many people have asked for over the years with ASP.NET is built-in support for developing web applications using a model-view-controller (MVC) based architecture. Last weekend at the Alt.NET conference in Austin I gave the first public demonstration of a new ASP.NET MVC framework that my team has been working on. You can watch a video of my presentation about it on Scott Hanselman’s blog here.

    What is a Model View Controller (MVC) Framework?

    MVC is a framework methodology that divides an application’s implementation into three component roles: models, views, and controllers.

    • « Models » in a MVC based application are the components of the application that are responsible for maintaining state. Often this state is persisted inside a database (for example: we might have a Product class that is used to represent order data from the Products table inside SQL).

    • « Views » in a MVC based application are the components responsible for displaying the application’s user interface. Typically this UI is created off of the model data (for example: we might create an Product « Edit » view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object).

    • « Controllers » in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI. In a MVC application the view is only about displaying information – it is the controller that handles and responds to user input and interaction.

    One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application. Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.

    The MVC pattern can also help enable red/green test driven development (TDD) – where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.

    A few quick details about the ASP.NET MVC Framework

    I’ll be doing some in-depth tutorial posts about the new ASP.NET MVC framework in a few weeks once the bits are available for download (in the meantime the best way to learn more is to watch the video of my Alt.net presentation).

    A few quick details to share in the meantime about the ASP.NET MVC framework:

    • It enables clean separation of concerns, testability, and TDD by default. All core contracts within the MVC framework are interface based and easily mockable (it includes interface based IHttpRequest/IHttpResponse intrinsics). You can unit test the application without having to run the Controllers within an ASP.NET process (making unit testing fast). You can use any unit testing framework you want to-do this testing (including NUnit, MBUnit, MS Test, etc).

    • It is highly extensible and pluggable. Everything in the MVC framework is designed so that it can be easily replaced/customized (for example: you can optionally plug-in your own view engine, routing policy, parameter serialization, etc). It also supports using existing dependency injection and IOC container models (Windsor, Spring.Net, NHibernate, etc).

    • It includes a very powerful URL mapping component that enables you to build applications with clean URLs. URLs do not need to have extensions within them, and are designed to easily support SEO and REST-friendly naming patterns. For example, I could easily map the /products/edit/4 URL to the « Edit » action of the ProductsController class in my project above, or map the /Blogs/scottgu/10-10-2007/SomeTopic/ URL to a « DisplayPost » action of a BlogEngineController class.

    • The MVC framework supports using the existing ASP.NET .ASPX, .ASCX, and .Master markup files as « view templates » (meaning you can easily use existing ASP.NET features like nested master pages, <%= %> snippets, declarative server controls, templates, data-binding, localization, etc). It does not, however, use the existing post-back model for interactions back to the server. Instead, you’ll route all end-user interactions to a Controller class instead – which helps ensure clean separation of concerns and testability (it also means no viewstate or page lifecycle with MVC based views).

    • The ASP.NET MVC framework fully supports existing ASP.NET features like forms/windows authentication, URL authorization, membership/roles, output and data caching, session/profile state management, health monitoring, configuration system, the provider architecture, etc. »)

    A voir:

    • https://pvergain.wordpress.com/2007/03/13/critique-de-larchitecture-aspnet/ (« Le problème avec ASP. Net est qu’il n’y a qu’un objet qui traite les demandes http, c’est l’objet PAGE. C’est lui qui a le contrôle de tout, et donc il mélange le code dit de «contrôle», et le code qui pilote la «visualisation» des éléments en html. Et bien souvent, on mélange aussi le code qui pilote le «Modèle» c’est à dire l’obtention des données directement depuis la base de données avec Ado.Net (c’est ce qu’on obtient lorsqu’on fait du WYSIWYG dans Visual Studio en choisissant les Sql Data Source et les glissant-déposant sur l’ihm). Cet anti-modèle (ou anti–pattern) a été souvent pointé du doigt par les architectes et développeurs, car en plus de faire produire du code spaghetti (bien que orienté objet), il rend impossible les tests systématisés (automatisés).« )
    • http://dosimple.ch/articles/MVC-ASP.NET/ (« Dans le framework ASP.NET la vue est un fichier HTML agrémenté de balises ASP. Le contrôleur et le modèle sont en général mélangés dans un objet qui dérive de la classe System.Web.UI.Page. »)
    • http://www.castleproject.org/monorail/index.html (« MonoRail is a MVC Web Framework inspired by Action Pack. MonoRail differs from the standard WebForms way of development as it enforces separation of concerns; controllers just handle application flow, models represent the data, and the view is just concerned about presentation logic. Consequently, you write less code and end up with a more maintainable application. Although the project name is MonoRail, we do not have any affiliation with the Mono project. MonoRail runs on Microsoft .Net 1.1, 2.0 and Mono.« )
    • http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework (« ASP.NET MVC Framework is a Model-view-controller framework which Microsoft is adding to ASP.NET. It allows an application to be built as a composition of three roles: Model, View and Controller. A Model represents the state of a particular aspect in the application. Frequently, a model maps to a database table, with the entries in the table representing the state of the table. A Controller handles interactions and updates the model to reflect a change in state of the application. A View ASP.NET MVC Framework couples the models, views and controllers using interface-based contracts, thereby allowing each component to be easily tested independently. The view engine in the MVC framework uses regular .aspx pages to design the layout of the UI pages onto which the data is composed; however any interactions are routed to the controllers rather than using the postback mechanism. Views can be mapped to REST-friendly URLs. ASP.NET MVC Framework has been launched as a Community Technology Preview on December 10, 2007 extracts necessary information from a model and renders a UI to display that.. »)
    • http://www.hanselman.com/blog/ScottGuMVCPresentationAndScottHaScreencastFromALTNETConference.aspx ( » I attended the ALT.NET Conference last weekend in Austin, TX. I personally find the name « Alt » as in « Alternative » too polarizing and prefer terms like « Pragmatic.NET » or « Agile.NET. » At the conference I suggested, partially in jest, that we call it « NIH.NET » as in « Not Invented Here.NET. » 😉 Ultimately this is a group that believes in:
      • Continuous Learning
      • Being Open to Open Source Solutions
      • Challenging the Status Quo
      • Good Software Practices
      • DRY (Don’t Repeat Yourself)
      • Common Sense when possible.

      ScottGu gave an hour long presentation on the upcoming MVC Framework and I took some guerilla video. ScottGu’s presentation is here in Silverlight and it’s about 60 minutes long. Considering it’s so long, the video squished nicely. This was the first time the MVC Framework was shown publicly. Note that this was a Prototype, not the Production code and both ScottGu and I make that point a number of times to drive home that it’s early. Some of the code was written on a plane, just to give you an idea. After The Gu did his piece on the MVC Framework, I showed some prototype hacking that I’d done over the previous few days along with some work Phil Haack did. My presentation is here as Silverlight and it’s about 30 minutes long. I showed the Model View Controller with Controllers in IronPython and an IronPython view using a WebFormViewEngine. Then I talked about the possibilities of alternate ViewEngines and showed Phil Haack’s prototype RubyViewEngine. »)

    • http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx ( » ASP.NET MVC Framework (Part 1) I’m going to use a simple e-commerce store application to help illustrate how the ASP.NET MVC Framework works. For today’s post I’ll be implementing a product listing/browsing scenario in it. Specifically, we are going to build a store-front that enables end-users to browse a list of product categories when they visit the /Products/Categories URL on the site>>Since it adds a testing project, does this require Team System? No – the good news is that Test Projects with VS 2008 are now supported with the VS 2008 Professional edition – and no longer require team system. You will also be able to use the VS Express and Standard edition products as well, and then use NUnit, MBUnit or some other testing framework with them (we’ll ship project templates for these as well…>> 2. Is it also possible to have this URL mapped: /Products/Beverages/3 instead of /Products/Beverages?page=3 or does it _need_ the parameter name? Yes – this is totally supported. Just set a route rule for /Products/Beverages with the format /Products/<Category>/<Page> – they’ll then get passed in as arguments to the action method:public List(string category, int? page) {}>>Also, some ideas and general remarks: 1. I’d love to see more helper methods for use in the views, I like how Ruby on Rails has many shortcuts for creating forms and formfields etc. Yes – we’ll have a rich library of helper methods for the views. They’ll include helpers to create all the standard forms, formfields and more.

    >>2. Migrations! Not a part of MVC but from my experience with Ruby on Rails I would love to see support for this somewhere, anywhere! It would fit perfectly with the more agile way of developing that is possible with ASP.NET MVC. Rob Conery is building .NET Migrations support as part of the SubSonic project, and recently joined Microsoft. You’ll be able to use this with ASP.NET MVC

    >>I’m also very keen to get my hands on the CTP. Scott, you mention, using Inversion of Control containers with the MVC framework. I’d be very interested in seeing a blog post on this subject. Also, will there be a sample application (with tests and IoC) available alonside the CTP? We have a IControllerFactory extensiblity point that owns creating Controller instances. You can use this with a IOC container to customize any Controller instance prior to it being called by the MVC framework. We’ll be posting samples of how to use this with ObjectBuilder and Windsor with the first CTP I believe

    >> Very cool! One thing I’d like to see guidance on is developing MVC apps with multiple UIs. You say here that it’s best to put your models and controllers in the web app, but say we want a Winforms, WPF, Silverlight, and Web UI all doing similar things. Or a Mobile Web UI and Desktop Web UI… Would these still each need their own Models and Controllers, or does it make sense to have one library that they all share? If so, how is that supported? I’m still new to MVC, so if I’m missing something conceptually here, tell me! That is a good question, and one we’ll need to provide more guidance on in the future. In general it is often hard to share the same controller across both client and web UI, since the way you do data access and the stateful/stateless boundaries end up being very different. It is possible – but some guidance here would ceretainly be useful. My team should hopefully be coming out with this in the future

    >>I really appreciate this material. Do you support the MVC pattern over the MVP pattern? Or are there just better scenarios for using each? The above approach I showed uses a MVC based pattern – where the Controller and the View tend to be more separate and more loosly coupled. In a MVP pattern you typically drive the UI via interfaces. This works well with a controls model, and makes a lot of sense with both WinForms and WebForms where you are using a postback model. Both MVC and MVP are perfectly fine approaches to use. We are coming out with the MVC approach for ASP.NET partly because we’ve seen more demand for it recently for web scenarios…

    >> When can we expect a similar chapter with SubSonic as the DAL and scaffolding provider? (see http://oakleafblog.blogspot.com/2007/11subsonic-will-be-toolset-for-microsofts.html I’ll be covering scaffolding in a future blog post. LINQ to SQL scaffolding is built-in with ASP.NET MVC and doesn’t require SubSonic. SubSonic will also obviously be adding new ASP.NET MVC features as well.

    >> My applications in .NET works with « 3 layers » pattern (business logic and data access in your own dll). How can i use this wonderfull MVC with my Models (data access) and Controllers (B.Logic)?? Because if i’m not reuse this, i’ve repeat code in every layer; then this MVC is not DRY (don’t repeat yourself) and the community don’t accept. There is no need to put your business and data logic in the same assembly as your controllers. You can split them up across multiple class library projects if you prefer

    >> Does this mean that with MVC, we no longer use LinqDatasource in the View section? While the LinqDataSource control will technically work in MVC Views, if you are using a MVC model you wouldn’t want to place it there. Instead you want to perform all of your data and application logic in the Controller layer – and then pass the needed data to the view.

    >> Perhaps I missed it somehow, but can you explain on which version of asp.net will this ctp run? The MVC framework builds on top of .NET 3.5

    >> Scott, this is amazing timing! The URL mapping features inherit in an MVC application are PERFECT for the upgrade to ASP.NET 3.5 I’m making to my spelldamage.com site. Hosting question, will hosts simply need to support the ASP.NET 3.5 framework to allow us to run ASP.NET MVC applications? Your hoster will need to support .NET 3.5 for the MVC support.

    >> Is’nt the MVC framework, in fact the Controller, implementation of the Front Controller pattern? Yes – the ASP.NET MVC framework uses a front-controller pattern. »)

    • http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx (« Last month I blogged the first in a series of posts I’m going to write that cover the new ASP.NET MVC Framework we are working on. The first post in this series built a simple e-commerce product listing/browsing scenario. It covered the high-level concepts behind MVC, and demonstrated how to create a new ASP.NET MVC project from scratch to implement and test this e-commerce product listing functionality. In today’s blog post I’m going to drill deeper into the routing architecture of the ASP.NET MVC Framework, and discuss some of the cool ways you can use it for more advanced scenarios in your application… What does the ASP.NET MVC URL Routing System do? The ASP.NET MVC framework includes a flexible URL routing system that enables you to define URL mapping rules within your applications. The routing system has two main purposes:
      • Map incoming URLs to the application and route them so that the right Controller and Action method executes to process them
      • Construct outgoing URLs that can be used to call back to Controllers/Actions (for example: form posts, <a href= » »> links, and AJAX calls)

    Having the ability to use URL mapping rules to handle both incoming and outgoing URL scenarios adds a lot of flexibility to application code. It means that if we want to later change the URL structure of our application (for example: rename /Products to /Catalog), we could do so by modifying one set of mapping rules at the application level – and not require changing any code within our Controllers or View templates.

    >> BTW, can you explain in short about the Active Record Type support in our MVC.

    .NET 3.5 has LINQ to SQL built-in – which is a great ORM. LINQ to Entities will also be built-into .NET 3.5 in the future (it also ships with the MVC setup). The MVC framework doesn’t require LINQ to SQL or LINQ to Entities as the data model – it also works with NHibernate, LLBLGen, SubSonic, DataSets, DataReaders, and/or any other data model with .NET. We will, though, provide out of the box scaffolding support for LINQ to SQL and LINQ to Entities that delivers nice integration with the MVC support.

    >> Question : What is this MockHttpContext in the UnitTest class? I mean, i can guess what it is .. but is it new in .NET 3.5 or the MVC framework? The MockHttpContext is an example mock object. It isn’t currently built-in with the MVC framework (with the first preview you’d need to create this yourself). I’m hoping that before the MVC framework ships, though, that there are a built-in set of mock objects and test helpers that you can use out of the box (without having to mock them yourself). Note that all core contracts and types with the MVC framework are mockable (non-sealed and interfaces). So you can also use any existing Mock framework to test it (RhinoMocks, TypeMock, etc).

    >> 1) Is it possible to use routes with a file extension if I don’t want to enable wildcard script mappings? For example, /Products/List/Beverages.rails or /Products/Detail/34.rails ? Yes – this is fully supported. We recommend changing your route rule to /[controller].mvc/[action]/[id]. When you install the ASP.NET MVC Framework we automatically register this .mvc extension – although you are free to use any other one you want.

    >> Hypothetically, do you think it would be possible to customise the route creation process so that route data could be gathered from attributes on actions? We don’t currently support this built-in, but hypothetically you could load all the controllers at app-startup and use reflection on them to calculate the route rules. This would enable the scenario you are after.

    >> Is it possible to use IronRuby as the coding language to target the MVC framework?? Yes – we’ll support both IronRuby and IronPython with the ASP.NET MVC Framework.

    >> I am liking this more and more. I can see how the routing configuration code in global.asax.cs could become quite large. In my application, I can see dozens, maybe hundreds of unique routing rules. Is there any way this configuration can be put in a file somewhere? That file would be read on Application start. Seems like that would make deployment of routing changes easier, too. We don’t currently have a pre-built file format for reading in mapping rules. But it should be relatively easy to build (you could even use LINQ to XML to read in and construct the rules).

    >> Just out of curiosity where in the HttpApplication cycle are the routing rules evaluated and are they exposed in any way to the rest of the HttpApplication cycle? My current security system grants permissions at what would become the controller-action level so if the route determination is made early enough I’d really like to drive my authorization off of it.
    The routing rules are resolved after the OnPostMapRequestRequestHandler event. This means that it will happen *after* your authorization rules evaluate. The good news is that this means you should be able to re-use your existing security system as-is.

    >> Will there be any way to use an XML document to create the routing rules outside of the Global.asax code? Yep – this scenario will be supported.

    >> I noticed that in Django, you have to repeat yourself kind of often when you have a deep nested hierarchy of pages. Your search & search-results pages seem to be continuing that trend. I’m sure I could come up with some hierarchical data structure which can be serialized into Route objects, but is the ASP.NET team planning anything along those lines that would come stock?

    With our first preview the Route type is not extensible (you can’t subclass it) – which means you sometimes need to register multiple routes for a series of things. For the next preview we are looking at enabling Route to be sub-classed – in which case you could easily encapsulate multiple URL mappings into a single registration.

    >> Have you thought about being able to define a regular expression for url matching and using backreferences or named captures as the tokenized url? I think this would allow for much more flexibility while keeping the list of routing rules down to a minimum.

    Yes – this is something we are looking at. The challange with regular expressions is that only a subset of people really understand them (and importantly – understand how to optimize them). But I agree that having this as an option would be super flexible.

    >> I must say that i am still worried about having to leave all the knowledge that we ave until now with webforms and start a new technology and still think that we would need some kind of a bridge to close the gap between today solution of webforms and tomorrow solution of MVC. Although the way you structure application flow will be different, I think you’ll be pleasantly surprised by the amount of knowledge overlap that exists. Authentication, Authorization, Caching, Configuration, Compilation, Session State, Profile Management, Health Monitoring, Administration, Deployment, and many, many other things are exactly the same. MVC views are also .aspx pages (that use .ascx user controls and .master files). So the concept re-use is quite heavy there as well. »)

    • http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx (« The last few weeks I have been working on a series of blog posts that cover the new ASP.NET MVC Framework we are working on. The ASP.NET MVC Framework is an optional approach you can use to structure your ASP.NET web applications to have a clear separation of concerns, and make it easier to unit test your code and support a TDD workflow. The first post in this series built a simple e-commerce product listing/browsing site. It covered the high-level concepts behind MVC, and demonstrated how to create a new ASP.NET MVC project from scratch to implement and test this e-commerce product listing functionality. The second post in this series drilled deep into the URL routing architecture of the ASP.NET MVC framework, and discussed both how it worked as well as how you can handle more advanced URL routing scenarios with it. In today’s blog post I’m going to discuss how Controllers interact with Views, and specifically cover ways you can pass data from a Controller to a View in order to render a response back to a client. In Part 1 of this series, we created an e-commerce site that implemented basic product listing/browsing support. We implemented this site using the ASP.NET MVC Framework, which led us to naturally structure the code into distinct controller, model and view components. When a browser sends a HTTP request to our web site, the ASP.NET MVC Framework will use its URL routing engine to map the incoming request to an action method on a controller class to process it. Controllers in a MVC based application are responsible for processing incoming requests, handling user input and interactions, and executing application logic based on them (retrieving and updating model data stored in a database, etc). When it comes time to render an HTML response back to the client, controllers typically work with « view » components – which are implemented as separate classes/templates from the controllers, and are intended to be focused entirely on encapsulating presentation logic. Views should not contain any application logic or database retrieval code, instead all application/data logic should only be handled by the controller class. The motivation behind this partitioning is to help enforce a clear separation of your application/data logic from your UI generation code. This makes it easier to unit test your application/data logic in isolation from your UI rendering logic.Views should only render their output using the view-specific data passed to it by the Controller class. In the ASP.NET MVC Framework we call this view-specific data « ViewData ». The rest of this blog post is going to cover some of the different approaches you can use to pass this « ViewData » from the Controller to the View to render.

    >> One question Scott: Let say i’m jumpng on MS MVC bandwagon, do i have to abandon asp.net Page Life cycle godddies, should i set up my mind to different approach. When you use the ASP.NET MVC approach you’ll want to have all post in your site go to your Controller. This helps ensure that the application can be easily tested and preserves the separation of concerns. This is different from using ASP.NET server controls which postback to themselves (which is very powerful too – but means that it can sometimes be slightly harder to test). What doesn’t change is that all of other ASP.NET pieces (forms authentication, role management, session state, caching, profiles, configuration, compilation, httprequest/response, health monitoring, etc, etc) works with both web forms based pages and MVC based pages. MVC UI are also built with .aspx, .master, and .ascx files – so there is a high level of skill re-use there as well.

    >> Some asp.net controls require <form runat=server>. If we use a asp:dropdownlist for example, we have to place in the asp:form. And this means viewstate comes back! Is there any way to get rid of hidden form fields? Or you suggest that we do must use classic HTML controls ? I’ll cover this more in my next blog in this series. We have helpers that can automate generating things like dropdownlists, etc. Think of them as controls for MVC. These don’t use viewstate and give you a little more control over the output of your HTML.

    >> It would be nice if you can just compare a bit our MVC with ROR. Within ROR, we can create tables, Columns and Rows with Ruby, without using a single line of SQL, and all its done through ActiveRecord. In short all CRUD advantages.

    >> SubSonic is almost in this line. Can you explain more in this line or how SubSonic can be used to take ActiveRecord Type advantages.

    RoR is made up of several components.

    « Action Controller » is the name of the MVC framework that Rails uses. That is the closest analogy to the ASP.NET MVC Framework – and at a high-level the ASP.NET MVC framework uses many of the same core concepts (URLs map to controller actions). The ASP.NET MVC Framework has a few additional features (like the ability to map incoming parameters directly to action method parameters). It is also more explicit about calling RenderView within the request.

    « Active View » is the name of the View engine that Rails uses. This is analagous to the .aspx/.master/.ascx infrastructure ASP.NET has. Our view engine is IMO a little richer, and supports several additional features (declarative controls/components, templating, multiple regions for nested master pages, WYSIWYG designer, strongly typed ViewData access, pluggable storage provider, declarative localization, etc).

    « Active Record » is the name of the ORM (object relational mapper) that RoR uses. This is analagous to an ORM in the .NET world – whether it is LINQ to SQL, LINQ to Entities, LLBLGen, SubSonic, NHibernate, ActiveRecord (the .NET version), etc. All of these ORMs have ways to map rows and columns in a database to objects that a developer then manipulates and works against (and can save changes back). The LINQ to SQL ORM is built-in to .NET 3.5 today, and LINQ to Entities will be built-in with .NET 3.5 SP1.

    I think from your follow-up question above you are referring specifically to the « migrations » feature in RoR – which allows you to define table schemas using code, and version the schemas forward/backward. There isn’t a built-in version of this in the core .NET Framework today – although the SubSonic project has recently released a version that allows you to-do this using .NET. You can find out more about it here: www.subsonicproject.com.

    >> Superb, …but I still longing for the IOC integration (Spring.NET, Windsor, StructureMap)…maybe in the next post ? I am planning on posting about IOC and dependency injection in the future (the ASP.NET MVC framework fully supports it and can be used with Spring.NET, Windsor, StructureMap, etc). I have a few other more basic MVC tutorials I need to get out of the way first – but testing and dependency injection are on the list for the future.

    >> Nice series, eagerly waiting to see AJAX approach in the new ASP.NET MVC Framework, so when shall we expext that.
    We will have ASP.NET AJAX support with the ASP.NET MVC Framework. I’ll talk more about this in a future tutorial series post.

    >> This is coming together nicely. I was just hoping you might explain why there are 3 different ways to pass the ViewData? Does each method offer something that the others don’t? If not, surely it would be best to choose one method and force all developers to follow the same practice? Conceptually there are two ways to pass viewdata – either as a dictionary, or as a strongly typed object. In general I recommend using the strongly typed dictionary approach – since this gives you better compilation checking, intellisense, and refactoring support. There are, however, some times when having a more latebound dictionary approach ends up being flexible for more dynamic scenarios« )

    • http://blog.wekeroad.com/2007/10/26/microsoft-subsonic-and-me/ (« Rather than try and come up with some lame metaphors and trite pop-culture references, I’ve decided to use some advice from English 101 Professor:

      “Whatever the hell you’re trying to say, just say it”

      So I will: I’m going to work for Microsoft. I just signed the offer letter. I’ll be working with the ASP.NET guys on the new MVC platform as well as some other groovy things like Silverlight. I get to work “across the hall” from one of my very good friends – Phil Haack. I think it’s worth pointing out that SubSonic hasn’t been “bought”. Some might smell a conspiracy here, but I’ll leave that to the X-Files and Cap’n Crunch crowd to drum up all the evil reasons why the mothership has “beamed me up”. SubSonic will remain under the same MPL 1.1 license it always has, and will remain as completely Open Source as it always has – nothing will change at all. I’m just getting paid, essentially, to work on it 🙂...This is crucial to me. I decided to be direct with him and make sure we both understood these important points:

      “I want to be sure I have complete creative control over SubSonic, and that you don’t censor my blog… is that cool?”

      Shawn’s response is why I took the job:

      “Well Duh…” (he added some more things that were a bit more eloquent than “duh” – but I don’t think I was listening).

      I can make jokes about the UAC on my blog? And make up fictional Matrix converstations with ScottGu? Sign me up! I start on November 12th, right after DevConnections in Vegas (come on by if you’re out that way at the DNN Open Force« )

    • http://www.subsonicproject.com/ (« A Super High-fidelity Batman Utility Belt. SubSonic works up your DAL for you, throws in some much-needed utility functions, and generally speeds along your dev cycle. Why SubSonic ? Because you need to spend more time with your friends, family, dog, bird, cat… whatever. You work too much. Coding doesn’t need to be complicated and time-consuming. »)
    • http://en.wikipedia.org/wiki/Test-driven_development (« Test-Driven Development (TDD) is a software development technique consisting of short iterations where new test cases covering the desired improvement or new functionality are written first, then the production code necessary to pass the tests is implemented, and finally the software is refactored to accommodate changes. The availability of tests before actual development ensures rapid feedback after any change. Practitioners emphasize that test-driven development is a method of designing software, not merely a method of testing. Test-Driven Development began to receive publicity in the early twenty-first century as an aspect of Extreme Programming, but more recently is creating more general interest in its own right. Along with other techniques, the concept can also be applied to the improvement and removal of software defects from legacy code that was not developed in this way . »)
    • ss
    • http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx
    • (« ASP.NET MVC Framework (Part 4): Handling Form Edit and Post Scenarios   The last few weeks I have been working on a series of blog posts that cover the new ASP.NET MVC Framework we are working on.  The ASP.NET MVC Framework is an optional approach you can use to structure your ASP.NET web applications to have a clear separation of concerns, and make it easier to unit test your code and support a TDD workflow. The first post in this series built a simple e-commerce product listing/browsing site.  It covered the high-level concepts behind MVC, and demonstrated how to create a new ASP.NET MVC project from scratch to implement and test this e-commerce product listing functionality.  The second post drilled deep into the URL routing architecture of the ASP.NET MVC framework, and discussed both how it worked as well asthird post discussed how Controllers interact with Views, and specifically covered ways you can pass view data from a Controller to a View in order to render a response back to a client.  In today’s blog post I’m going to discuss approaches you can use to handle form input and post scenarios using the MVC framework, as well as talk about some of the HTML Helper extension methods you can use with it to make data editing scenarios easierClick here to download the source code for the completed application we are going to build below to explain these concepts… Our Data Model. We are going to use the SQL Server Northwind Sample Database to store our data.  We’ll then use the LINQ to SQL object relational mapper (ORM) built-into .NET 3.5 to model the Product, Category, and Supplier objects that represent rows in our database tables. We’ll begin by right-clicking on our /Models sub-folder in our ASP.NET MVC project, and select « Add New Item » -> « LINQ to SQL Classes » to bring up the LINQ to SQL ORM designer and model our data objects…To learn more about LINQ and LINQ to SQL, please check out my LINQ to SQL series here The HtmlHelper object (as well as the AjaxHelper object – which we’ll talk about in a later tutorial) have been specifically designed to be easily extended using « Extension Methods » – which is a new language feature of VB and C# in the VS 2008 release.  What this means is that anyone can create their own custom helper methods for these how you can handle more advanced URL routing scenarios with it.  The objects and share them for you to use. We’ll have dozens of built-in HTML and AJAX helper methods in future previews of the ASP.NET MVC Framework.  In the first preview release only the « ActionLink » method is built-into System.Web.Extensions (the assembly where the core ASP.NET MVC framework is currently implemented).  We do, though, also have a separate « MVCToolkit » download that you can add to your project to obtain dozens more helper methods that you can use with the first preview release.
    • >> This is nice. But do you handle subcomponents? subviews? Is view reuse possible inside other view? This is very important for even for modest sized applications? How would you handle posts correcly inside of subviews 😉 ?The first public MVC preview doesn’t have the concept of SubControllers yet (where you can attach them for regions of a larger view).  That is something we have planned for to tackle soon though.

      >> However, liviu raises good questions about Sub-Controllers, Composite Views and AJAX scenarios. How Will the MVC framework address the complex wiring of different parts of a page to different controllers for async updates?? My brain hurts thinking about it, yet I have implement these portal pages all the time cos our customers demand it. The first ASP.NET MVC Preview allows you to call RenderView (for example: RenderView(« Edit »)) and have it apply to either a .aspx viewpage or a .ascx viewusercontrol.  This ends up being really useful for scenarios where you are doing AJAX callbacks and want to refresh a portion of a page.  These callbacks could either be to the same Controller that rendered the origional page, or to another Controller in the project. We don’t have all the AJAX helper methods yet for this – but you could roll them yourself today.  We’ll obviously be releasing an update that does include them in the future.

    • >> Can you provide an example of how we might use a server side control to generate the drop down list or a textbox (a la WebForms) along with the pro’s and con’s of each approach? Personally, I do not like the old ASP <%= … %> syntax; but if there is a good reason to use it then I am willing to change that opinion. The main reason I showed the <% %> syntax in this post was that we don’t have the server-side MVC control equivalents available yet for this dropdown and text scenario.  That is on our roadmap to-do though – at which point you don’t need to necessarily use the <% %> syntax. In general what we’ve found is that some developers hate the <% %> syntax, while others prefer it (and feel that controls get in the way).  We want to make both sets of developers happy, and will have options for both. 🙂
    • >> Great work on the MVC model, it is a clean and intuitive model that appears to scale well. My only recommendation is that your actions (verbs) appear after the ids (nouns), e.g. [Controller]/[Id]/[Action]/  That would keep the architecture noun focused, opposed to verb focused. With this approach you can easily build an administrative interface on a public read-only site by adding verbs such as /edit/ or /delete/ at the end of your URL. A simple security rule can be added to the Controller that says ignore all Verbs after a noun, such as category or product, if user is not part of an administrative group. Thanks for the suggestion Josh.  You can do this today by creating your own custom route registration.  In the next preview I believe Route will be extensible so that you could also create a single resource route that supports these semantics.>> I was wondering if we could get an idea of the official « roadmap » for asp.net mvc?  Specifically, I’d like to know what features the team plans to release on what dates … ultimately, when this thing will RTM.  As I’ll be evaluating mvc and monorail for an upcoming app, this kind of information would really be helpful in determining which direction to go. We don’t have a formally published roadmap just yet – we will hopefully publish one early next year though.« )
    • http://en.wikipedia.org/wiki/ASP.NET_AJAX (« ASP.NET AJAX, formerly code-named Atlas, is a set of extensions to ASP.NET developed by Microsoft for implementing Ajax functionality. Including both client-side and server-side components, ASP.NET AJAX allows the developer to create web applications in ASP.NET 2.0 (and to a limited extent in other environments) which can update data on the web page without a complete reload of the page. The key technology which enables this functionality is the XMLHttpRequest object, along with Javascript and DHTML. ASP.NET AJAX was released as a standalone extension to ASP.NET in January 2007 after a lengthy period of beta-testing. It was subsequently included with version 3.5 of the .NET Framework, which was released alongside Visual Studio 2008 in November 2007.« )

    Posted in 2007, Acces aux données, active record, AJAX, Architecture logicielle, ASP.NET, Développement logiciel, design pattern, DotNet, IDE-GUI, Ironpython, javascript, open source, ORM, RIA, ruby, tests, Web Frameworks | Tagué: , , , , , , , | Leave a Comment »

    Des nouvelles du monde python: ironpython, windmill, satchmo, grok + le réseau social ohloh.net

    Posted by patrick sur novembre 10, 2007

    Quelques nouvelles du monde python:

    • différentes mesures de la popularité du langage python sur http://www.langpop.com/. Le langage C vient en première position tandis que Python se situe entre la 6e et la 12e position suivant les outils de mesure.
    • la version 2.06a de Ironpython est sortie (« …this release includes all of the changes we have made in the past month. The most noteworthy differences include:
      • the IronPython project is now distributed under the Microsoft Public License (Ms-PL)
      • improved support of COM events under the –X:PreferComDispatch flag
      • the abstract syntax tree for IronPython is being hardened so to speak
      • we have included an updated DLR sample in the source zip file – ToyScript
      • Internally we have migrated our Visual Studio project and solution files over to a Visual Studio 2008 beta release. While we’ve modified these files in the source distribution of IronPython to be compatible with Visual Studio 2005 and the msbuild tool, it’s possible we may have missed something. If you experience any problems building IronPython from VS tools please let us know.
      • The ToyScript sample is not intended to be distributed with IronPython on a permanent basis and will likely be released in some other fashion in the not too distant future. »)
      • For whatever reasons, IronPython 2.0 Alpha 6 started to invoke delegate to abstract method. (Previous versions didn’t.) This triggered Mono bug 317488 which is apparently hard to fix. https://bugzilla.novell.com/show_bug.cgi?id=317488 I developed completely insane workarounds to avoid this problem. Now you can laugh (or weep). https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/latest/patch-317488
    • Source: http://www.voidspace.org.uk/python/weblog/ (« ...Web application testing with Windmill. A new (Python based) browser testing tool was just announced on the Testing in Python Mailing List. It comes out of the Chandler Project and claims to implement a larger set of a browser testability than Selenium: Windmill.
      • Windmill is an Open Source AJAX Web UI Testing framework written in Python and JavaScript originally for testing the Chandler Server WebInterface at OSAF. After spending time with Selenium we realized we had a variety of needs that weren’t being fulfilled and built Windmill from the ground up. Windmill implements cross browser testing, in-browser recording and playback, and functionality for fast accurate debugging and test environment integration. Support for Firefox, IE6/7, Safari on * *Windows, Linux and Mac OS 10.4 and 10.5.)
    • http://www.ohloh.net/projects/search?page=1&q=django (« Ohloh is an open source network that connects people through the software they create and use. Ici on recense les projets basés sur le framework web python Django. »)
    • http://www.satchmoproject.com/ (« ...Satchmo’s mission is to use Django to create an open source framework for creating unique and robust online stores. To provide maximum flexibility, Satchmo is licensed under the BSD license…. This project was started by a group of individuals that were interested in using the Django framework to create a robust shopping cart solution. After some more discussions, we have decided to focus on building a modular framework of shopping cart or eCommerce packages that can be easily put together to form a full store. Here’s a bunch of questions you might be asking yourself at this point… Why use Django? First off, we wanted to use Python for the project. Many of us have experience with similar PHP based projects and we quickly realized that they tend to break down pretty quickly under the unwieldy syntax, lack of good OO support and hackish nature of many of the projects. Once we decided on Python, there were many frameworks to evaluate. They all have tradeoffs but there are some things we really liked about Django:
      • Robust, scalable system that has been used on major commercial sites
      • Clean separation of program logic from presentation
      • Nice abstraction of SQL (but with the capability to code SQL if required)
      • Solid documentation
      • URL mapping capabilities will be very useful for a shopping cart solution
      • Out of the box admin capabilities making it easy to get up and running & provide enhanced security for multiple users in a store.

    This list is not exhaustive and there could be endless debate and flamewars on the choices but we’ve all reached this decision independently and encourage you to investigate & make your own choice….« )

    • http://grok.zope.org/ (« Grok is a web application framework for Python developers. It is aimed at both beginners and very experienced web developers. Grok has an emphasis on agile development. Grok is easy and powerful. You will likely have heard about many different web frameworks for Python as well as other languages. Why should you consider Grok?
      • Grok offers a lot of building blocks for your web application.
      • Grok is informed by a lot of hard-earned wisdom.

    Grok accomplishes this by being based on Zope 3, an advanced object-oriented web framework. While Grok is based on Zope 3, and benefits a lot from it, you do not need to know Zope at all in order to get productive with Grok« )

    ..etc, etc…

    Posted in Ironpython, python, REST, tests, Web applications | Tagué: , , , , | Leave a Comment »

    DotNet, Mono, C#, Ironpython: quelques liens et définitions en vrac

    Posted by patrick sur août 13, 2007

    Pour mon retour de vacances, quelques liens sur le framework .NET, C# , Ironpython et Mono (des projets étant à l’horizon au mois de septembre 2007).

    Les framework DotNet

    http://en.wikipedia.org/wiki/.NET_Framework#.NET_Framework_2.0 («  .NET Framework 2.0. Released with Visual Studio .NET 2005, Microsoft SQL Server 2005 and BizTalk 2006.

    .NET Framework 2.0 shipped with Windows Server 2003 R2 (not installed by default).« )

    http://en.wikipedia.org/wiki/.NET_Framework#.NET_Framework_3.0 («  .NET Framework 3.0, formerly called WinFX,[1] includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems. It is also available for Windows XP SP2 and Windows Server 2003 as a download. There are no major architectural changes included with this release; .NET Framework 3.0 includes version 2.0 of the Common Language Runtime.[2]. NET Framework 3.0 consists of four major new components:

    http://en.wikipedia.org/wiki/.NET_Framework#.NET_Framework_3.5 (« In an interview with Channel 9, Jason Zander, general manager of the .NET Framework team at Microsoft, discussed version 3.5 of the framework.[3] This version will include a new compiler that will support new features such as Language Integrated Query (LINQ), as well as new language features in C# and VB.NET. This version of the framework, containing version 3.0 of the CLR (as opposed to CLR 2.0 in .NET Framework 3.0), will be included in Visual Studio 2008. »)

    http://en.wikipedia.org/wiki/Mono_%28software%29 (« Mono is a project led by Novell (formerly by Ximian) to create an ECMA.NET compatible set of tools, including among others a C# compiler and a Common Language Runtime. Mono can be run on Linux, FreeBSD, UNIX, Mac OS X, Solaris and Windows operating systems.

    Mono current version is 1.2.4 (as of May 2007). This version provides the core API of the .NET Framework as well as support for C# 2.0 and Visual Basic.NET. Support for the 2.0 APIs[1]. Complete support for the .NET Framework 2.0, including the .NET 2.0 version of Windows.Forms, is planned for Mono 2.2, by the end of 2007[2]. Implementation of .NET Framework 3.0 is under development under an experimental Mono subproject called Olive, but the availability of a Mono framework supporting .NET 3.0 is still not planned yet[3]. An open source implementation of Silverlight has now been integrated into Mono proper, parts of it are in the core of Mono, parts are implemented as part of the Olive components. «  )

    http://en.wikipedia.org/wiki/IronPython (« IronPython is an implementation of the Python programming language, targeting .NET and Mono, created by Jim Hugunin. Version 1.0 was released on September 5, 2006.[1]
    Until version 0.6 it was released under the Common Public License.[2] Following recruitment of the project lead in August 2004, IronPython was made available as part of Microsoft‘s Shared Source initiative. Authors claim that the license,[3] while not reviewed by the Open Source Initiative, conforms to the OSI’s definition of open source. With the 2.0 alpha release, the license was again changed, to the Microsoft Permissive License.[4]
    IronPython is written entirely in C#, although some of its code is automatically generated by a code generator written in Python. »
    )

    IronPython Integration Sample and the WPF Designer (Aaron Marten explains how to get the IronPython integration sample working with Visual Studio with WPF Designer)

    http://en.wikipedia.org/wiki/Windows_Presentation_Foundation (« The Windows Presentation Foundation (or WPF), formerly code named Avalon, is the graphical subsystem feature of the .NET Framework 3.0 (formerly called WinFX)[1] and is directly related to XAML.[2] It is pre-installed in Vista,[3] the latest version of the Microsoft Windows operating system. WPF is also available for installation on Windows XP SP2 and Windows Server 2003. It provides a consistent programming model for building applications and provides a clear separation between the UI and the business logic. A WPF application can be deployed on the desktop or hosted in a web browser. It also enables richer control, design, and development of the visual aspects of Windows programs. It aims to unify a host of application services: user interface, 2D and 3D drawing, fixed and adaptive documents, advanced typography, vector graphics, raster graphics, animation, data binding, audio and video.
    Microsoft Silverlight is a web-based subset of WPF. During development it was named WPF/E, which stood for « Windows Presentation Foundation Everywhere ». Silverlight is based on XAML and JScript. The Silverlight subset enables Flash-like web and mobile applications with the exact same code as Windows .NET applications. 3D features are not included, but XPS, vector-based drawing and hardware acceleration are included
    . »)

    http://en.wikipedia.org/wiki/Microsoft_Silverlight (« Microsoft SilverlightWindows Presentation Foundation/Everywhere or WPF/E) is a proprietary runtime for browser-based Rich Internet Applications, providing a subset of the animation, vector graphics, and video playback capabilities of Windows Presentation Foundation. Version 1.1 also includes a complete version of the .NET Common Language Runtime, named (code-named CoreCLR,[1][2] so that Silverlight applications can be written in any .NET language. Silverlight aims to compete with Adobe Flash and the presentation components of Ajax. It also competes with Sun MicrosystemsJavaFX, which was launched a few days after Silverlight »)

    http://www.mono-project.com/Moonlight (« A page to track the various projects that make up the Mono-based implementation of Silverlight. The goals are:

    • To run Silverlight applications on Linux.
    • To provide a Linux SDK to build Silverlight applications.
    • To reuse the Silverlight engine we have built for desktop applications.

    You can see screenshots of the work in progress here.

    Silverlight 1.1 (http://silverlight.net) is a new development technology for the Web created by Microsoft based on the CLR that augments it with a 2D retained graphics system and media playback engine and ships a subset of the standard .NET libraries. Currently the Moonlight project supports both Silverlight 1.0 (canvas + browser-based scripting) as well as 1.1 applications (canvas + ECMA CLI powered execution engine).

    Building an open source implementation on top of Mono is an obvious choice as Mono has most of the technologies required to implement it but is missing a few components. In this page we will track the work required and the design decisions involved in creating an open source version of it.« )

    Les environnements de développement:

    http://en.wikipedia.org/wiki/Visual_Studio_.NET#Visual_Studio_2005 (« Visual Studio 2005, codenamed Whidbey (a reference to Whidbey Island in Puget Sound), was released online in October 2005 and hit the stores a couple of weeks later. Microsoft removed the « .NET » moniker from Visual Studio 2005 (as well as every other product with .NET in its name), but it still primarily targets the .NET Framework, which was upgraded to version 2.0. Visual Studio 2005’s internal version number is 8.0 while the file format version is 9.0.[4] Microsoft released service Pack 1 for Visual Studio 2005 on 14 December 2006.[5]

    Visual Studio 2005 was upgraded to support all the new features introduced in .NET Framework 2.0, including generics and ASP.NET 2.0. The IntelliSense feature in Visual Studio was upgraded for generics and new project types were added to support ASP.NET web services. Visual Studio 2005 also includes a local web server, separate from IIS, that can be used to host ASP.NET applications during development and testing….. »)

    http://en.wikipedia.org/wiki/Visual_Studio_.NET#Visual_Studio_2008 (« Visual Studio 2008,[9], code-named Orcas, is the successor to Visual Studio 2005 currently under development. It is slated to be officially launched on February 27, 2008.[10] The codename Orcas is, like Whidbey, a reference to an island in Puget Sound, Orcas Island. The successor to Visual Studio 2008 is codenamed Hawaii.

    The first publically available beta was the September 2006 CTP, released on September 28, 2006. The latest beta is Beta 2, released on July 23, 2007.

    Visual Studio 2008 is focused on development of Windows Vista, 2007 Office system, and Web applications. Among other things, it brings a new language feature, LINQ, new versions of C# and Visual Basic languages, a Windows Presentation Foundation visual designer, and improvements to the .NET Framework. It will also likely feature a new HTML/CSS editor influenced by Microsoft Expression Web.[11] J# will not be included.[12].NET Framework 3.5 and by default configures compiled assemblies to run on .NET Framework 3.5; but it also supports multi-targeting which lets the developers choose which version of the .NET Common Language Runtime (out of 2.0, 3.0, Silverlight CoreCLR or .NET Compact Framework runtimes) the assembly will run on. »)

    http://www.monodevelop.com/Main_Page (« MonoDevelop is a free GNOME IDE primarily designed for C# and other .NET languages« )

    Les flux RSS/ATOM intéressants:

    http://ironpython-urls.blogspot.com/feeds/posts/default?alt=rss (« La planète Ironpython« )

    http://www.voidspace.org.uk/python/weblog/index.xml (De nombreuses infos sur Ironpython)

    http://www.ironpython.info/index.php/Main_Page (« wiki sur ironpython. IronPython brings Python to .NET, and allows you native access to the .NET framework and classes. In addition, Microsoft has built IronPython support into the following systems:

    http://tirania.org/blog/miguel.rss2 (« le blog de Miguel de Icaza« )

    http://blogs.msdn.com/jomo_fisher/atom.xml (« le blog de Jomo Fisher« )

    http://msdn.microsoft.com/fr-fr/rss.xml (« Les nouvelles de microsoft »)

    http://blogs.msdn.com/mitsufu/atom.xml (Le blog de mitsufu)

    http://blogs.developpeur.org/tom/atom.aspx (Le blog de Thomas Lebrun sur WPF et C#)

    http://blogs.msdn.com/tims/rss.xml (« Le blog de Tim Sneath« )

    Les sites (avec ou sans flux RSS/Atom)

    http://groups.google.com/group/mono-olive (« Olive is the group used to develop the post-2.0 Mono-based technologies. This includes Mono’s efforts to implement pieces of the 3.0 and 3.5 stacks as well as the new Silverlight implementation. »)

    http://www.codeplex.com/IronPython (« IronPython is a new implementation of the Python programming language running on .NET. It supports an interactive console with fully dynamic compilation. It is well integrated with the rest of the .NET Framework and makes all .NET libraries easily available to Python programmers, while maintaining full compatibility with the Python language.« )

    http://www.wikimindmap.org/viewmap.php?wiki=en.wikipedia.org&topic=IronPython

    http://www.wikimindmap.org/viewmap.php?wiki=en.wikipedia.org&topic=mono_%28software%29

    http://dotnet.developpez.com/cours/ (« Les meilleurs cours et tutoriels .NET »)

    http://csharp-source.net/ (Des projets C# open source)

    http://monofrance.tuxfamily.org/ (« Monofrance Portail francophone des utilisateurs de Mono. »)

    Divers

    http://www.castleproject.org/activerecord/index.html (« The Castle ActiveRecord is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records. project is an implementation of the

    Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly. »)

    Les dernières nouvelles:

    http://en.wikipedia.org/wiki/C_Sharp#C.23_3.0_new_language_features (« C# 3.0 is the next version of the language as proposed by Microsoft. It includes new features inspired by functional programming languages such as Haskell and ML, and is driven largely by the introduction of the Language Integrated Query (LINQ) pattern to the Common Language Runtime.[3]« )

    http://blogs.developpeur.org/tom/archive/2007/06/27/silverlight-pas-convaincu-par-silverlight-essayer-alors-zero-gravity.aspx (« Interfaces graphiques avec Silverlight: ‘Si vous voulez voir ce qu’il est possible de faire, pendant 4 semaines, avec une équipe de 5 personnes (des designers utilisant Expression Blend et Expression Design, des développeurs utilisant Visual Studio 2008 et des animateurs), alors jettez un oeil sur Zero Gravity. Voir http://timheuer.com/blog/archive/2007/06/26/zerogravity.aspx‘ »)

    http://tirania.org/blog/archive/2007/Aug-04.html (« Pretty much all the C# 3.0 features are now completed. As Marek points out there are a couple of areas that still need some work (collection initializers and anonymous types), but we are in good shape to complete the LINQ support in Mono’s C# compiler…The majority of our C# 3.0 support will be available in Mono 1.2.5. The recent developments (type inference) did not make it into the release, so folks will have to wait for 1.2.6…« )

    http://tirania.org/blog/archive/2007/Jul-02.html (« Marek Habersack has written a Guide on Porting ASP.NET Applications to Linux using Mono. This is a complement to Jonathan Pobst’s Porting Winforms Applications to Linux using Mono. AjaxWidgets: In addition to the two Guides above, the Thomas from Frost Innovations (the makers of Ajaxwidgets has written a tutorial on how he run ASP.NET 2.0 apps on Linux with Mono.« )

    http://ironpython-urls.blogspot.com/2007/07/new-release-ironpython-20-alpha-3.html (« We have just released IronPython 2.0 Alpha 3. This release is a snapshot of the on-going progress with IronPython 2.0 and the DLR. The most significant changes in this release include more work to use dynamic sites from IronPython and improved evaluation mode support. This release is also timed to closely coincide with the IronRuby release and provides a near-identical DLR release…« )

    http://tirania.org/blog/archive/2007/Jun-21.html (« Needless to say, we believe that Silverlight is a fantastic development platform, and its .NET-based version is incredibly interesting and as Linux/Unix users we wanted to both get access to content produced with it and to use Linux as our developer platform for Silverlight-powered web sites. »)

    http://spellcoder.com/blogs/dodyg/archive/2007/08/08/7756.aspx (« In Summary :

    • Less Code Matters A Lot.
    • C# 3.0 really shines for back end development. It doesn’t add much value in the current ASPX Page structure code behind.
    • IronPython really shines for CodeBehind code or anything related to UI programming. I can’t fathom using it for back end programing due to the lack of refactoring support.
    • Using both C# 3.0 and IronPython in the same project is a joy.« )

    Posted in active record, C_sharp, DotNet, Ironpython, mono | 1 Comment »