Pylons or TurboGears vs. .NET or Java - java

We're embarking on a project for a client. They plan on having about 50k users by the end of the year. We're pushing to use Pylons w/ Mako and SQLAlchemy, and our contact there is excited about it, but some of his colleagues are wary because it's not .NET or J2ee (they're used to enterprisey stuff).
Their web app will have some data analysis that we'll offload as well as a twang of social networking features. (basically all they have so far is some Flex mockups for UX)
I'm looking for some evidence with regard to development time, or other reasons that will help our argument to reassure the customer.
The other options is that we're barking up the wrong tree and have no idea. I hope that's not the case.
Any references to case studies or whatnot would be nice. The best I could find are
http://www.oracle.com/technology/pub/articles/rubio-python-turbogears.html
and
http://www.oracle.com/technology/pub/articles/devlin-python-oracle.html
which are a bit dated (wrt to TG2 and whatnot)
Thanks!

If you're looking for a success story for a customer, Virgin Charter is using Pylons with SQLAlchemy for their site. This is a high-value transaction system as people are booking very expensive flights through the site.
For a more high-traffic site, Reddit is now running on Pylons, along with Charlie Rose.
SQLAlchemy and Mako were both designed by Mike Bayer (A veteran Java programmer), SQLAlchemy being based on the best of Hibernate and with the same powerful principles and patterns that Hibernate supports.
If they're wary of deploying something they're not familiar with, Pylons runs on Jython, and the latest SQLAlchemy (0.6 branch) is about ready on Jython too. This would let you package up a full Pylons app into a WAR file for deployment which would reassure their Java-types.
For general Python, consider pointing out all the big animation studios that use it, and the other various srouces S.Lott points out.

It's almost easier to build a quick Proof of Concept service that demonstrates how clean and simple it is.
A simple SQLAlchemy mapping with a quick demo of query processing.
A simple template showing how cool Mako is.
A simple Pylons app to put the two together.
Most important -- use their application and their data. Not a lame hello world; not an existing tutorial.
If they want to compare your clean, elegant demo of their app with .NET and J2EE, they'll see that other languages lead to a much, much bigger code base.
Edit
Show them this: http://python.org/about/success/
Also, one of the best Python demos is to do things the way the SQLAlchemy and Django tutorials do things -- in interactive python from the >>> prompt. Nothing is more exciting than programming which is so simple you can do it interactively.
You won't find a lot of compelling case studies. Python is a community. .Net and J2EE are products. .Net has Microsoft's advertising backing it; Microsoft can afford to do extensive surveys and studies of their product. Same for Sun (soon to be Oracle) and J2EE -- lots of marketing hype backing up their claims.
Python just has what's on the Python.org site (http://python.org/about/). The various related projects (Pylons, Mako and SQLAlchemy) don't have lavish case study whitepapers. They do have a large number of downloads, and lots of word of mouth.
But if someone's looking for "proof" that Python works better than .Net, there's not going to be much.

They are crazy if they want to use j2ee imho. Visual Studio/C# is very nice, especially if you are not trying to do anything tricky. However, if you want to customize the C# way of doing things beyond what it was explicitly designed for it can quickly turn into a mess -- you get mired in automatically generated XML configuration files &c. Of course, I also think that Pylons with SQLAlchemy might turn into a mess because they too generate so much stuff that you ultimatly might end up having to reconfigure. If you want complete control, I would recommend a less intrusive environment, like Werkzueg. Please read my essay on writing MVC with no invisible means of support.

Related

Nodejs: Where or How to write complicated business logic?

Recently I got introduced to node.js and cool packages like express and jade. I have few questions consistently knocking my door:
If I pick node.js to build my next website, I will be using JavaScript to write my server-side complicated logic? but I don't think you can compare JavaScript with Java or Python to write server-side code as they have such a vast ocean of libraries. Is node.js really meant for it? or I have missed something?
Can I call Java or Python from node.js?
Not quite sure what most of these folks are talking about.
A "vast ocean of libraries" is something the community is actively working on. Check this: http://search.npmjs.org/#/_analytics -- there were 8 packages published yesterday
Its not going to solve your software design for you. As for where and how to write business logic, many of us embrace mvc or mvvm or something close to it. If you're building an application and like how Rubyists (for example), structure their code you might look at doing something just like that -- aint nobody going to tell you how to structure your code.
Check https://github.com/joyent/node/wiki/modules
Some of the more popular libraries for doing the day to day:
Express: http://expressjs.com/ - https://github.com/visionmedia/express
Sinatra inspired, use it to build a typical web app
Stats: 3407 watchers, 286 forks, on pull request 778
Compare that to Sinatra itself! 2529 watchers, 366 forks
With connect, it supports all kinds of middleware:
sessions,
all kinds of routing,
static files
some 15 different templating engines
validation, form handling, etc, etc
Socket.io: http://socket.io/ - make it 'real-time'
DNode: https://github.com/substack/dnode - do rpc between anything
Backbone.js: http://documentcloud.github.com/backbone/ - MVC
Variety of techniques for re-using your models on the server:
http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
Spine.js: http://maccman.github.com/spine.tutorials/index.html - MCV
Techniques for re-using code on the server:
http://maccman.github.com/spine.tutorials/node.html
caolan/async: https://github.com/caolan/async - Help manage your async business logic
Database, pick your poision
node_redis, https://github.com/mranney/node_redis - or one of the eight other clients
"This is a complete Redis client for node.js. It supports all Redis commands"
node-mysql, https://github.com/felixge/node-mysql - or one of eleven other clients/orms
node-mongodb-native, https://github.com/christkv/node-mongodb-native
node-postgres, https://github.com/brianc/node-postgres
There's also a host of ORMs out there, if thats your bag. Things like http://mongoosejs.com/, http://sequelizejs.com/ and friends
Test-driven development is at the core of node. There are 15 different TDD packages to choose from that range from full code coverage analysis to custom assert modules.
Saying all modules are incomplete is silly. There is an incredibly dedicated group of people building and maintaining tons working open-source in this community every day.
There might be reasons to pass over node, but its not for an inactive community or lack of libraries.
I would say you missed something - more specifically, the core purpose of Node.js, that is, the asynchronous I/O model.
I started a little pet project to test Node.js - how it "feels" and how to program on it. I became impressed by the ease of working in such ecosystem: Node.js code is easy to write (although its asynchronous paradigm is not that straightforward for the conventional programmer), libraries are easy to build etc. etc. Even npm is amazingly easy: I just found the most straightforward way to provide code of your own as a library is to make a public package of it - and it is absurdly easy!
However, there is not much good tools to work with Node.js. Maybe because it is too easy to do anything, most libraries are partially-implemented, undocumented solutions.
Also, note that the relevant difference of Node.js is not the JavaScript language, but the asynchronous I/O model. It is the most interesting aspect of Node.js, but the asynchronous programming style is not as well tested as the conventional way of web development. Maybe it is really the marvel that is propagandized - or perhaps, it is not as good as promised.
Even in the case it pays off, will you have enough developers to maintain such an (at least still) unusual codebase? If you can get a lot of advantages from the asynchronous "way of life" of Node.js, you can use more consolidated languages and frameworks, such as Twisted for Python (which is my preferred languabe, so take care with my opinion :) ). There may be something like this for Java, too. Anyway, I suspect that you do not have a lot of interest in this model for now, since your question focuses more on languages than in the programming paradigm, so Node.js does not have much to offer to you anyway.
So... no, I would not develop something professonaly in Node.js for now, although I think it is both fun and instructive to study. You can do it, however - just do not do it without having in mind the main purpose of Node.js: asynchronous-IO, event-driven programming. If it is what you want, Node.js is a good alternative.
Ryan did not start with JavaScript. A large part of why Node was created in JavaScript is that JavaScript lacked vast oceans of libraries.
Those vast oceans of libraries are almost all written in blocking code.
To take full advantage of Node.js you need to limit your self to non blocking libraries. Which means that might need to write some libraries to complete your project in Node.js.
I think you'll be surprised by the amount of work you can get done in JavaScript via Node.js. There are a bunch of libraries available for Node and more are being written all the time. Furthermore, native extensions are also available for those times where you might need to drop down to a lower-level.
If you think there's a gap where Node won't be able to provide for your business logic, take a look around NPM or give Google a quick serch to see if anyone else has already solved your problem.
Of course, you can use Python, PHP, c++ or other technologies with nodejs 'cuz node can run it as a child process. Nodejs give you the freedom to use any technology which you want inside itself. You can use whatever you want combining the most performance programs.
There are some things that JavaScript just can't do. If you come up against those Node might not be the best choice for your app. However you can probably accomplish most of what you need.
As far as the API being limited, I suggest you take a look at npm and all the libraries in its repository. Specifically ones like underscore.js. Many aim to fill in the gaps of what native JavaScript lacks compared to other languages.

Java libraries and frameworks overviews

Which web sites could you recommend, where I shall find overviews of different java libraries and frameworks that are currently preferable to use in development of applications?
update: To be more precise, I've liked to find a site that will be like a magazine about java, where will be the overviews, comparisons, best practices, examples and other useful information about java (technics, libraries, frameworks and so on) for different purposes. The aim of magazines is not to cover all the things of their subject area, but to present more actual, interesting and useful things only.
I really like the design on Open Source Software in Java. They've got it laid out by type to start with, plus when you dig down you can find several competing projects for each category.
For example clicking on 'HTML Parsers' gives this (and more - this is just a partial clip):
I hope this helps.
The world of java has so many libraries that it would be practically impossible to recommend anything without some kind of understanding about what kind of application you are actually writing. Are you writing a blu-ray disc, a game for a java phone, an android app, a desktop application, a server side computation process, a web service, a web site.... the list of things that java can and does do is huge.
The same thing goes for frameworks too. I would always say (although many people on this site disagree) that you should only look for a framework when you are finding something difficult, and the framework makes that thing easier, without making other stuff harder. Some people say you pick your framework first.....
Perhaps if you gave more details on what kind of thing you were trying to attempt, the community might be able to point you towards some useful stuff.
As a side note, remember that the internet is full of people with opinions - just because they are loud, it doesn't make them right - after all http://en.wikipedia.org/wiki/On_the_Internet,_nobody_knows_you%27re_a_dog

Deciding among with Java technologies should use - beginner

I am not new to software developing, but in the last years I was almost completely involved with web applications development, most likely to PHP with MySQL/PostgreSQL.
Now I am changing focus. I would like to start programming for desktop applications, with Java. The decision about language was motivated by the following reasons: it is a mature language, has space into the market, it is multiplatform, full of resources, and has some very nice IDEs (I am using netbeans 6.9).
I am not new to OOP concepts (or most of them at least), but Java has a huge gamma of solutions (technologies, frameworks and so on), and I am getting lost with that. Can't decide what is the most appropriate solution to adopt and learn from.
That said, let's get to the point. I will describe the software targets, some things I has adopted so far, and expect someone to give me some trail to follow filling the messy points.
My application is a small business application. Usual stuff about products, sales, cash management. It needs to run into a small office, with some computers (not a fully standalone desktop application). Not every user can do everything. Some would have privileges to access financial stuff, others only sell, others only fulfill products, and so on.
Per above highlevel definition, we know that it will operate like a client-server application. One server will be installed into just one machine, all others will just have the client. I am using HSQL as backend for persistence.
Would like to use Swing to build the UI (to keep theming based on the OS). Possibilities for the client include sending email (not directly, but through some already-set email client [Thunderbird, Outlook]) and printing (to any available printer in the network).
For this I am using Desktop API.
Alright, finally we got were I am loosing the grip: which framework / technology do you recommend to make development quick (pre-built forms based on the available tables), and as modular as possible?
As I said, different users would have different privileges, but instead of just checking and disabling, I would like to keep modules separated. In different packs, or something like that.
EJB? BlueJ? JavaBeans? OSGi? Swing Application Framework? I'm kinda lost with those. Any help will be appreciated.
If you're lost, keep it simple.
For the kind of desktop apps you describe, you'll need Swing and JDBC. If you switch to web, substitute JSPs written using only JSTL and servlets. You'll have to know HTML and CSS to write JSPs. You can embellish those with JavaScript as needed.
You'll go a long way with just those.
The others you mentioned are just noise until you become more comfortable:
EJBs are for enterprise scale apps. You get to leave a lot of complex stuff like threading, object pooling and lifecycle, etc. to an app server and concentrate on expressing your business logic in distributed, transactional components called Enterprise Java Beans. Not necessary to start.
BlueJ is a beginners IDE designed to shield folks from the complexities of Java. I wouldn't recommend it.
OSGi - modular deployments for web apps. Not necessary to start.
Swing App Framework? I'm not familiar with it - I don't write Swing. If you mean Spring, I think it's an excellent framework, but not necessary to start.
This is a bit off-topic, but I think it should be said anyway.
My application is a small business application. Usual stuff about products, sales, cash management. It needs to run into a small office, with some computers (not a fully standalone desktop application). Not every user can do everything. Some would have privileges to access financial stuff, others only sell, others only fulfill products, and so on.
You are attempting something very ambitious here. There are countless existing applications for doing this kind of thing for small business, some of them household names. What makes you think that you can can do better? What makes you think you can compete?
The fact that you are new to Java makes this doubly ambitious.
My advice would be:
If you have dreams of making lots of money out of this, forget it. You are >10 years too late.
If you are doing this for some client, your company or yourself to use, they / you would probably be better off using an off-the-shelf business application.
If you are doing this for "the public good", you labors would be more fruitful if you joined some existing open source business application project.
If you are just doing this "for fun" ... go for it. (This doesn't strike me as a "fun" project though ...)
Starting off with java, swing desktop app is normal... I must say though that the components included in the default, i never liked, i thought they were too ugly. https://substance.dev.java.net/
Is a look and feel lib for java.
So do your app, think it through though and make sure you have some sort of design in mind.
Its easier and often faster if you have an idea of where you're going visually than if you just start coding and hope you reach somewhere you like.
Get paper and pencil out,scribble little notes and drawings of your GUI.
You don't necessarily need frameworks and the lot, if your app will need to store data then look at the JDBC driver to connect to mysql, or have a look at embedded databases such as HSQLDB...

Best approach to creating a database driven Java website?

I'm fairly new to programming and new to java, but I'd like to jump in the deep end with a little database driven website project. I've read quite a lot about requirements in the 'real world' requesting experience with Spring and Hibernate, so I have those installed on netbeans and a project created (if I hit run I get the default spring page). Now I just need a little guidance as to where to start designing my app (please tell me if I'm getting in a bit too over my head for a beginner!).
Should I start off with my classes? - create all my classes as they map to my database tables and decide which attributes and methods each will require?
Can anyone suggest any good books for maybe.. making a java based website from scratch (i.e. from design right through to deployment) that might be useful for a beginner?
Any help appreciated thanks.
Edit: since posting this I've found a brilliant book that fits my needs just right to get started. Firstly I tried both spring in action and hibernate in action - but found both to be a bit too heavy for my novice mind. Instead I got the Java EE 5 Development with Netbeans 6 book https://www.packtpub.com/java-ee5-development-with-netbeans-6/book and its been a great help. If you use netbeans and are in a similar position to me, I'd say pick it up!
Too over your head? Depends on what you hope to accomplish. Are you trying to create a revenue-generating site to which users will be asked to trust credit card numbers and other sensitive information? Then yeah, you're getting way ahead of yourself. Is this a tool for personal use or a toy you're throwing together primarily as a learning experience? Then I say "Pffffft!" to the notion of over-the-head-ness. Go for it.
As to where to start, I say start with whatever portion of this beast is clearest to you. Have a solid idea of what the database is going to look like? Then start with it and its supporting classes. Have a clear vision of what the guts of the code are supposed to do? Start there. Etc. And if all things are equal, I'd say start at the bottom with the database layer and work your way up -- but that's just me.
And as for the books, can't help you there, but I'm sure somebody can.
I suggest to take a look at web application frameworks such as Spring's Roo or Grails. Sadly I have no experience with Roo. But I do have some experience with Grails.
With Grails you will be working mostly with Groovy, a language similar to Python, but still using the JVM. You'll still have the option to use Java anywhere you like (I think). Grails (and maybe Roo too?) manages Spring and Hibernate for you.
As for books on Grails, I recommend "Grails in Action". I have read a little of "Grails 1.1 Web Application Development" and it also seems to be a good reference. BTW, netbeans supports Grails too.
Not trying to gut your goals, but if you are wondering whether to start with your classes, I would suggest you work on your programming skills more.
I'd suggest taking a look at Larman's "Applying UML & Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)" as well as a book on relational database theory (you need to know how to model databases properly.)
You can try your hand at building a database driven web app, and it might give you an insight into how to do it, but you need have some programming maturity to take those skills into the non-trivial.
This is a completely personal opinion so please take it with a grain of salt: Before someone tackles the building of a data-driven application with the purpose of eventually being able to use it in non-trivial projects, that person needs to have a good exposure to programming (by good I mean a LOT, say 1-2 introductory courses, 1-2 intermediate and at least one junior-level course, perhaps a total of 15-30 credits.) Unless that person is a natural programming virtuoso, I don't see it happening otherwise.
I would suggest, if you are serious about programming, to spend a substantial amount on learning the fundamentals before tackling something like this.
Good luck.

Adventures of a Web Programmer in Applicationland (or, Practical Java Help Needed)

Alright, so I am a compsci college student who, being in college, has not branched out towards a certain specialization yet. I have been programming since I was a young teenager, certainly know my stuff - well versed in about eight different languages as well as compsci theory, etc. In addition, I have about four years of web programming (PHP mainly) behind me, having started freelance work in that area since web 2.0 became hot.
My summer job now as an intern of sorts is to write an application for an industrial, not software-related startup. This application will be used to manage production lines and logistics flow. I have chosen Java for my language because I don't want to shoot myself in the foot.
I am well-versed in the syntax of Java, in its data structures, language theory, and such, but I have absolutely no idea where to start. I can picture the program perfectly in my mind, I understand the problem clearly and got the solution's theory nailed. Namely, I have no idea what libraries to use, and am scared that they won't be well documented.
Here are some general outlines of what I'm going to make:
Two applications, one server and one
client (of which there will be many
copies).
The server and clients obviously will
communicate via (I don't know).
Both the server and the client
software will have GUIs.
The server software will have to
query a MySQL database.
The client software must be 'live' in
the sense that the GUI updates when a
change is made to the database. This
is one of the reasons why it can't be
a web application.
I'm not even sure if a framework is right for me or not. I've used MVC tons of times in my web freelance work, but I dont know how that will translate for desktop applications.
In short, I'm looking for the right libraries for the job, as well as advice on whether or not I should use a framework (and if so, which). Thanks.
This is a summer intern job? To be honest, this sounds more like a major project if you ask me. You say the start-up is not software related? Who came up with this idea? Do they have any idea of the (huge) scope that something like this might actually entail?
The business of software development is something quite different to language syntax and libraries. It's about requirements gathering, defining a spec, writing code, ensuring quality of that code, having it tested and so on. These are not things an intern should reasonably be expected to pick up. For something like this you should be under more experienced supervision, someone you can learn from, someone who has done this before.
That being said, unless there's a really good reason, I would probably do such a thing as a Website rather than a desktop app. Desktop apps are a lot more complicated in many ways. You need to code both a client and a server. Communication is a bit trickier. You have to worry about the issue of maintaining state in multiple applications, how to handle updates being pushed around and so on.
In short, it's a big job. Even a Web site is a big job but a lot of these issues go away. You could do this with Java. I've certainly coded my fair share of Java Websites but PHP might be a far simpler bet.
Also, desktop development on Java is, well, torture. Swing is (imho) tried and true but also incredibly painful to develop in. Other desktop libraries (eg Netbeans RCP, Eclipse SWT) are more modern but have other idiosyncrasies.
Desktop remoting libraries include things like Spring remoting, even Web services and other things like Burlap. For the server side, I'd be using either Tomcat or an application server (Glassfish is my preferred choice), servlets and Spring. Persistence can be done via Hibernate or Ibatis (or lots of other options).
But honestly, the desktop option is so much more complex than a Web-based one. You'd probably get a lot more done faster using PHP + jQuery + MySQL.
If you are doing this keep it as absolutely simple as possible. Try to define the absolute minimum you need to initially deliver and do that. Once someone has that they'll then have a better idea of what works for them and what doesn't. Basically it's easier to refine something that already exists vs define something that doesn't.
I recommend that you only build a web application. A web application can be 'live' in the sense you are describing it by using AJAX. It would be much easier to build just one thing. If you also want to have a rich client, then you need to build the UI in a technology you are not familiar with (like Swing or SWT) and design/implement the communication mechanism.
Have a look at Hibernate (ORM tool) and Spring (IoC framework). They have a somehow steep learning curve, but they will make your life easier at the long run. For the UI part perhaps JSF is easier for a beginner.
As a last note, I think you have an over-ambitious plan. What you are describing is not an easy project and requires expertise with a lot of technologies. Do not try to do everything in one shot.
Java Desktop 6 (JRE)
JDBC (built-in in any JRE)
MySQL JDBC drivers (freely downloadable)
for communication you have several choices: RMI (built-in) however this days I recommend
learning something like Java Web Services (JAX-RS)
Libraries?
JDBC for the database. You may want to look at ORM mechanisms like Hibernate
I would recommend the Apache Commons libraries for all your utility work (handling files, IO etc.). There's a lot of stuff there to save you reinventing the wheel.
A standard logging framework like Log4j will allow you to log in lots of different ways, filter your logs and plug into monitoring solutions easily.
You don't say whether browser-based solutions are acceptable for the client/server GUI, and that decision will drive a lot of the further architecture.
If you're looking at browser-based solutions, then I would advise a grounding in servlets regardless of any framework you ultimately choose (no doubt a lot will be recommended here).
By this stage it's getting to be a major project. Perhaps you need to concentrate on getting the fundamentals (client/server functionality) working, and worry about the GUI later. Otherwise it's a huge amount of work (and GUI work can draw an enormous amount of time).
Just one nitpicking:
Both the server and the client software will have GUIs.
I advice you to have a headless (in awt parlance) server, with an administration GUI, not a GUI-server.
Well this can go as wild as you can think of or you can go and do KISS.
If you would like something that is really simple (as in not using any frameworks):
* In the server side you can use RMI. This server side will use plain JDBC to connect to your MySQL database. But some said that this is kind of old, so if you want to get funky you can try JAX-RS which can return a JSON objects/XML to your client.
* Your client can be made using Swing (assuming you are developing desktop) or Servlet + JSP (assuming you are developing webapp) and connect to your server by calling the RMI objects/JSON objects/XML that is exposed by the server.
If you would like to get nasty which will help you in terms of code maintainability you might want to plug-in Spring + Hibernate into this application.
Good luck!

Categories