views:

324

answers:

5

Hello,

I'm employed at a fairly big company here in Germany and got the job to create the main website for it which will feature:

  • Static contents; Information and Presentations
  • An employee area (around 6000 employees) featuring various things from calendars, job descriptions, some sort of groups
  • Too many other dynamic things I can't list here

I have decided to use COBOL for the job, it may be very underrated but it is a very powerful language, especially for business apps and, as my co-workers say, web (2.0) development too.

I also need to use COBOL because all the backend and transactions system of the company is programmed in it (some small parts were programmed in LISP too, I don't know exactly why). I also have received an API that makes it possible to use COBOL with MySQL easily.

This is a big project and it will probably take more than 2 months programming it.

  • What do I have to expect when building a huge web app in COBOL?
  • Are there web frameworks for COBOL available? Some sort of MVC?
  • Are there any good resources for practical web-development with COBOL?

Thanks in advance

+5  A: 

Please, please, please do not use COBOL for this. Anyone who has to support the site in the future will thank you for choosing a more... modern tool.

I recommend that you use a web framework to write the front-end, such as PHP, ASP.NET MVC, etc. Then create an API (or a separate process with some sort of an interface, if required) that will allow that tool to talk to your COBOL back-end. This will allow you to use the web framework on the front end - where it will shine - while allowing you to leverage your company's significant investment in COBOL.

Justin Ethier
I have to use COBOL, as said.
felixm
@felixm: "I have decided to use COBOL" sounds like you making a bad decision. "I have to use COBOL" sounds like someone else making a bad decision. Who -- specifically -- is making this bad decision? Why are you compelled to use COBOL? Who is compelling you?
S.Lott
I thought you decided to use it? Anyway, I recommend that you use a web framework to write the front-end, such as PHP, ASP.NET MVC, etc. Then create an API (or a separate process with some sort of an interface, if required) that will allow that tool to talk to your COBOL back-end. This will allow you to use the web framework on the front end - where it will shine - while allowing you to leverage your company's significant investment in COBOL.
Justin Ethier
+6  A: 

What do I have to expect when building a huge web app in COBOL?

It will take a long time. Frameworks like Django, Ruby on Rails or CodeIgniter are designed specifically to create web sites in very little time.

Most of these frameworks can build working dynamic content web sites in 20 minutes. COBOL cannot. Unless you can type really quickly, you'll probably have very little workable code in the time you could learn and build a site with any more modern tool.

Are there web frameworks for COBOL available? Some sort of MVC?

Asking this question now indicates that the choice of using COBOL is a really, really bad idea.

The usual strategy is to chose the framework first. After making the framework choice, we endure the language required to leverage that framework.

However, there's always http://www.coboloncogs.org/HOME.HTM

Are there any good resources for practical web-development with COBOL?

http://search.barnesandnoble.com/COBOL-Programming-Using-the-NET-Framework/Ronald-D-Reeves/e/9780130668431

Practical web development is done with web-specific frameworks. Any of the dozens of Python web frameworks, Ruby on Rails, any of the PHP frameworks, any of the Java frameworks. They're highly specialized to build web sites quickly and cheaply.

COBOL is not highly specialized for this. Nor (outside the i-Series) does anyone seriously consider COBOL for web development.

Your best hope would be to use as many external libraries as possible and write as little COBOL as possible. You have to make heavy use of the COBOL to C features of OpenCOBOL to work with the C-language API's and -- in effect -- build your site in C with a COBOL wrapper.

S.Lott
I highly recommend *COBOL On Cogs*. Since I started using it my productivity has skyrocketed!
ChaosPandion
As a full time "hard core" COBOL programmer and "small time" web developer, I have to agree with S.Lott. Don't use COBOL for front end web development! It is really going to hurt! On the other hand, leveraging your COBOL systems to provide back end support for web driven applications may be a reasonable option.
NealB
@NealB: Many folks do precisely that -- Web front-end kicks off back-end processing via COBOL programs.
S.Lott
Like NealB said, use COBOL to interface with existing back end systems. The web part is so different from the type of applications COBOL was made for. Think about interfacing with web servers, using HTTP, handling raw form data, generating HTML and JSON. It will take a lot of time making COBOL do things that other systems support natively. Go for a web framework, create a REST or SOAP based service layer that exposes functions from existing systems and use COBOL to implement those services.
Kwebble
A: 

Microfocus provide a product called Enterprise Server which allows COBOL to interact with web services.

If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B's interface section as a web service.

For program A, you then generate a client proxy and A can now call B via a web service.

Of course, because B now has a web service any other type of program (command line, Windows application, Java, ASP etc.) can now also call it.

They also have another product "COBOL.Net" which provides an interpreter to .NET IL for COBOL programs.

Because this is on the .NET platform, you can mix-and-match with C# etc.

This allows you the best of both worlds. You keep the existing COBOL back-end but can develop the web application with modern tools e.g. ASP / MVC / Struts / JSP. And you chain the two together with a web service.

nzpcmad
Based on comments made by original poster it looks like they are using OpenCOBOL which is basically a COBOL to C translator. Maybe they intend to leverage this "feature" to break out of the COBOL box.
NealB
A: 

If you HAVE to use Cobol because you need to integrate with some legacy COBOL APIs, how about you use Cobol to expose the data via some RESTful (or similar) API. Then write your web app in something modern like Django (which is very nice). The Python web app could then easily access the necessary data via the RESTful API you are providing in Cobol.

That would allow you to use the right tool for each job: A modern web app framework for the web app and some Cobol code to expose data to which you only have a Cobol API.

Juergen Brendel
A: 

The initial reaction most people have to developing a web application in COBOL is very negative!

In general, I agree, and recommend not using COBOL for front end web development simply because there are other tools that come with a lot of pre-packaged support for building this sort of application. Support generally comes through library add-ons and pre-built interfaces to web services. The implementation language itself is less important.

As one example, Ruby on Rails is an application framework based on the MVC model using Ruby (language) to "glue" it all together. A fair bit of your development effort evaporates as long as you stick to the Rails framework. However, break the framework and it might very well break you. I see using frameworks such as Ruby on Rails ideal for new development where you control everything from the ground up.

Your situation may be somewhat different. If I have understood correctly, you have a base of COBOL applications and a mySQL database that need to be integrated into a new web application. The Rails framework may or may not be particularly useful in this context. It all depends on how you "meet in the middle". It is a fairly common industry practice to use strong web-enabled tools to front-end web applications with COBOL based back ends. Making the two come together is a fairly platform specific art form.

The same comments apply to any other web application framework and tool set. I just used Ruby on Rails as an example. Bottom line is that not many people (me among them) have given much thought to fronting a web application using COBOL.

Not withstanding the above, I noticed that you are using openCobol in your shop. This could make building a COBOL only solution a reasonable prospect. Unlike many COBOL implementations, openCobol comes "web ready" and has a database independent abstract layer so getting at your mySQL database should be quite painless. Web readiness is partly a consequence of openCobol using the C Application Binary Interface (ABI). The C ABI should greatly facilitate working in a mixed language environment and makes interacting with a CGI (Common Gateway Interface) pretty much trivial; as can be seen from this example.

OpenCobol makes building a web application feasible, but is it practical? As noted earlier, unless there is a documented web application framework in place to draw upon, you will end up doing a lot of it yourself. I think you may have already come to this conclusion when posting your question. As far as I can tell, developing such a framework is also feasible but does not yet exist. If you go forward with this project, maybe you could contribute toward developing a web application framework for openCobol.

I found the "Cobol on Cogs" reference in the accepted answer a little unfair, you asked a serious question and deserved a completely serious answer. This type of reference probably reflects a bit of "red necked" closed mindedness toward COBOL (Yes, I'm ready for and expecting down votes on this one).

NealB