I need a simple rules engine, I think? [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I need some advice on the best approach to solving this problem.
I've researched DROOLS, Java Rule Engine and a few others. All of these are powerful, and have good things about them. I don't know which (if any) will be the best choice for me.
I have one business object. (simplified for demo)
Person
firstName:String
lastName:String
departMent:String
hireDate:Date
I need to write an editor in a web application that will allow for complex rules to be built around these fields. I need to support complex nested AND/OR logic. I just need basic operators, and the rule should simply evaluate to true or false. If the rule evaluates to true or false, one action will occur respectively.
For example,
firstName CONTAINS "value" AND
(lastName EQUALS "input" OR department
CONTAINS "input")
I had thought, maybe I should just write my own parser and evaluate the logic in my own code. I don't know what to do, any advice or links to something to read would be greatly appreciated. Is there a specific design pattern I could research?
How would you solve this problem? One reservations about the rules engines is that maybe they are too complex for just a simple problem?

This is not an yes/no question, but I can probably share my experiences, and hope it helps.
I have used DROOLS quite successfully in a few projects. Apart from some cases (another team had issues with DROOLS under heavy load,) DROOLS is quite an useful library.
I built an application which:
1. read input from a source
2. chose the next action based on the input from a set of available operations
As trivial as it looks, it needed to be very flexible:
1. The input was a variable set of name-value pairs, names not predetermined.
2. values, presence/absence of certain name/values (based on occurrence/absence of events), trigger different actions.
3. The business rules can change while the application is running.
Maybe there are better solutions, but for better or worse, I ended up using DROOLS. I developed a BPEL in which the decisions are made by the DROOLS component. The DROOLS component internally reads the decision making rules from a Microsoft Excel spreadsheet. It rebuilds the rules if there is a change in the file.
Now the domain experts change this spreadsheet when required, and we do not go through painful deployments!
If you want a sophisticated UI, DROOLS Guvnor is a readily available web-application (with rich UI,) which would help your domain/subject-matter experts to build rules and store them in a database.

The Drools documentation talks about when to use a rules engine. http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e181
From the docs...
The shortest answer to this is "when
there is no satisfactory traditional
programming approach to solve the
problem.". Given that short answer,
some more explanation is required. The
reason why there is no "traditional"
approach is possibly one of the
following:
-- The problem is just too fiddle for
traditional code.
The problem may not be complex, but
you can't see a non-fragile way of
building a solution for it.
-- The problem is beyond any obvious
algorithmic solution.
It is a complex problem to solve,
there are no obvious traditional
solutions, or basically the problem
isn't fully understood.
-- The logic changes often
The logic itself may even be simple
but the rules change quite often. In
many organizations software releases
are few and far between and pluggable
rules can help provide the "agility"
that is needed and expected in a
reasonably safe way.
-- Domain experts (or business analysts)
are readily available, but are
nontechnical.
Domain experts often possess a wealth
of knowledge about business rules and
processes. They typically are
nontechnical, but can be very logical.
Rules can allow them to express the
logic in their own terms. Of course,
they still have to think critically
and be capable of logical thinking.
Many people in nontechnical positions
do not have training in formal logic,
so be careful and work with them, as
by codifying business knowledge in
rules, you will often expose holes in
the way the business rules and
processes are currently understood.
When not to use...
As rule engines are dynamic (dynamic
in the sense that the rules can be
stored and managed and updated as
data), they are often looked at as a
solution to the problem of deploying
software. (Most IT departments seem to
exist for the purpose of preventing
software being rolled out.) If this is
the reason you wish to use a rule
engine, be aware that rule engines
work best when you are able to write
declarative rules. As an alternative,
you can consider data-driven designs
(lookup tables), or script processing
engines where the scripts are managed
in a database and are able to be
updated on the fly.

I would suggest your own parser. In this context why can't you serialize the object and use AJAX to validate it in the back end? It then seperates the validation logic from the UI.

I would take a look at some sample rules engine interfaces and see which ones I like. You can look at web based email rules interfaces to get some ideas. If you really need a simple rules engine, you just need to create a good interface, and then you can send the rules to the server with javascript.

Probably not. You need a decent domain model. Not one where your objects are just data placeholders. Are your users likely to be able to understand and use such a complex rules system, and wouldn't those that do prefer just programming in java, where they have proper encapsulation and refactoring support? Rules systems only work with simple rules on a restricted domain, where you can explain people not trained as programmers how to build them. And don't forget rules building is just programming, so you still need version control, tests, and don't want globals.

Wouldn't Jython be usefull?
Each expression/complex-rule could be the body of a function.
So the user provides the body, and your code puts the function spec around it, and then execute it.
You can also put any Java objects / variables of your own into the jython context to be used in your script/ function body.
Then you have a standardized, extendable widely used language at your fingertips.
But i think the Jython editor could be a challenge.

Have you tried JBehave?
JBehave is a framework for Behaviour-Driven Development (BDD). BDD is
an evolution of test-driven development (TDD) and acceptance-test
driven design, and is intended to make these practices more accessible
and intuitive to newcomers and experts alike. It shifts the vocabulary
from being test-based to behaviour-based, and positions itself as a
design philosophy.

Related

Business logic: moving from stored procedures to BRMS. Pros and cons [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
We're developing an application which implements business logic in stored procedures on an Oracle database. It has been this way for a few years.
The business rules are many, diverse and get often customized for specific customers.
Currently they're somewhat intermixed with data management and data retrieving code.
I've been thinking of proposing to move some of the logic in a BRMS.
My colleagues are likely to oppose that because:
they experienced that the current implementation based on PLSQL is considerably more efficient than one having logic implemented in the middle tier, i.e. in Java.
Our users often do really need short response time from our software, because it also directs their operations in industrial environments.
our team is not big and the people most knowledgeable about business rules are also the ones that implemented the stored procedures. They're not used to work with Java and, above all, using PLSQL allows us to ignore all the cruft regarding frameworks, system integration and mapping between different tiers.
If we're going to switch to something else other than PLSQL it has to be something that doesn't require lot of java coding and is possibly framework independent.
PLSQL allows to leverage the application's weight onto an expensive DBMS. Ideally we'd like an effective integration between BRMS and DBMS.
To better present my proposal I'd need some objective figures about the following issues:
performance penalty for moving from stored proecdures to BRMS
integration between DBMS and BRMS
abstraction offered by BRMS compared to the one offered by PSLSQL and pure java code
training needed to for the switch
I looked on the net and found a few references. Unfortunately most of them compare implementations being either pure Java code vs stored procedures or pure Java code vs BRMS. I couldn't find anything comparing stored procedures and BRMS, or that describe how to integrate a stored-procedures solution with a BRMS.
Many thanks.
If you select a well established engine, it is VERY likely that performance of the rules engine will be much better than performance of a system that access a database to retrieve and evaluate rules. The engine that we are using at the moment can evaluate about 2 million objects against a single complex rule in about 50 milliseconds. That's 2 million complex objects.
One of the features of an engine should be a UI that allows business people to create and manage their rules,not programmers. With proper engine, programmers SHOULD NOT create and manage rules, ever. You are probably looking at the open source engines (Drools, etc.) They generally miss this point. That's why you have an impression that your guys will have to learn Java in order to create business rules. That's a wrong assumption to begin with.
The entire point of a business rules engine is to abstract your business logic from the main code. Your database-based system does not offer the level of abstraction the normal BRE would. I don't know your system but I'm 99.9% positive on that, based on what I know about engines and "database rules systems". You need a database to store rules. That's all.
That depends on the engine you choose. Training is usually minimal for IT and somewhat mid-average for business.
Hope this helps.
Oracle has a built-in rules engine, which is not widely publicised. However it's built with PL/SQL and of course the interface to it is PL/SQL.
I have used it for a few ETL tasks but nothing that required high performance for bulk data. If you are willing to sacrifice some performance for flexibility however I'd recommend it.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14288/toc.htm

Is Java is an "island" for developing new apps and libraries? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I will be making a cross-platform, graphical mathematical modeling application, for example, a user can drop a bunch of nodes on a canvas, specify some mathematical relationships between them, and run a simulation. I'm also interested in seeing in this being a web app.
I have had some programming experience in Java, MATLAB, Python, but I have never made a large application, thus I know very little about software architecture, and how multiple languages work together.
I am trying to figure out the best IDE, language(s), etc., to work in. The previous work done by my group has a lot of C/C++ libraries to draw from for back-end work, like simulation. I was told by my boss that Java is an "island" for development, meaning the Java app has difficulty using libraries from other languages and making its own libraries usable to other languages.
Is this true? Can someone shed some light on this topic?
Also, then what tools should I be using? I am ready to learn anything, but I'm trying to go for what would be the most productive route. Learning and then programming everything in C/C++ does not seem like a very productive route to me currently.
Things I've looked at so far include WindowBuilder/GWT Designer (this seems like a way to make both desktop and web apps), Mono/GTK+/MonoDevelop, and Delphi
Please feel free to be as verbose as you can, thanks!
I fear this post may get closed as off-topic. But it seems a little too specific to toss, IMHO.
Java interoperates with a lot of non-Java projects, products, etc. However, a major feature of it is portability, so you'll find that folks go out of their way to stay within the JVM environment. In that sense it's an "island".
I suggest you think about exactly what you want to interoperate with and get specific - see whether the hooks are there or not.
For your back-end C/C++ libraries, you'll need to implement JNI interfaces. I'd describe this as having a small but moderately steep learning curve - not a lot to learn, but it takes a little thought - especially if the amount of data passed back and forth is so large that performance is an issue.
You may find that you don't have what you need with GWT for the graphical aspects of what you're doing.
I'd think hard about how much you need the web aspect. If you do, consider skipping a desktop-only solution (and maybe Java/GWT) altogether, and just going to the web. This is especially viable if you don't need to support older browsers.
I'm not going to touch the "what tools" question - it's too broad.
Considering Jython, Groovy, Clojure, and a whole host of other language adaptations for Java, I would firmly suggest that your boss does not know what he is talking about. Java also has the ability to execute native code if necessary, so it is not terribly difficult to incorporate other, non-JVM toolkits. But even if he were right and there was no cross-linguistic work with Java, the language has been around long enough, and it is verbose enough, that you can generally find libraries which will supply the inter-operability you're looking for.
Without knowing more about your specifics it will be hard to give a precise answer, but the general rule is that the language you know is better than the language you don't, so unless your language goes completely against the idioms required, use it. Eg. if you have in-house expertise in C/C++, those languages are perfectly adequate for building applications. JavaScript significantly less so.
You do not want bugs which are caused by faulty assumptions about the language. Those are nearly impossible to track, especially since you won't know where to look.
Well, if cross platform is an issue, I would suggest developing in Java, it makes everything very easy in that regard. As far as loading C/C++ libraries, I don't have much experience with it, but I would recommend taking a look at something like Java Native Access.
As far as tools go, they are wide and varied. I personally use Netbeans or Eclipse, but untimely that sort of choice comes down to what plugins you may need and what you personally prefer.
All in all, I would say program out a little stub of the application in different environments and different languages and see what you like. You really need to know the details of the application to make an informed decision, and it varies in most cases. Best of luck!

Java as back-end platform. Good choice? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
My company is about to start building the back-end for one of our new products. The idea is to build a layer that produces resources for every upper layer product (web site, mobile web site, mobile application), also, a significant part of it will be made available as an API for third party developers. You know, the typical start-up scenario.
We were planning on building our backend using Java Servlet Technology so our architecture was going to be dependant on Java, so the question is: What are the implications of Oracle scaring away open-source-aware developers and companies like mine?
Should I try to find an alternative to Java? Are you trying to move away from Java?
This question is not about technical issues with Java platform, but with legal implications of Oracle draconian intentions (my subjective point of view).
EDIT: Of course this question is subjective and argumentative, that's the kind of answer I want: opinions, and opinions are subjective and argumentative.
I suspect that Java will remain a strong back=end platform for a long time. Oracle, among other things, doesn't want to kill the golden goose. In addition, there are too many good back-end components based on Java, from Tomcat to messaging, to hibernate and spring, to groovy and grails; the market won't let them disappear for a long time.
Technically, Java is well suited for complicated back ends and large-scale problems; if you're building something simple and lightweight, using a framework like Rails along with an open-source database is often plenty.
Groovy and grails are a nice bridge from the lightweight approach of Rails to the full Java world, although groovy can be a little, um, peculiar sometimes.
We were planning on building our
backend using Java Servlet Technology
so our architecture was going to be
dependant on Java, so the question is:
What are the implications of Oracle scaring away open-source-aware
developers and companies like mine?
Are they? Last time I checked JBoss and Spring were going strong. Scala is being considered as a strong alternative for replacing Java (or it will shape the next best language for app/system development on the JVM.)
What exactly are you referring to here? I don't follow. Now, if you are going in direct competition to Oracle and their stack (and all their integrated solutions, like Oracle Financials), then maybe you might have something to worry about.
Or if you are (or intend on) doing something that violate (or can be interpreted as a violation in a court of law) the Java license agreements, then you might have to worry about Oracle (because it has the teeth to pursue them, which Sun did have.)
So, you need to be a bit more pragmatic and objective and define clearly what exactly your product role will be with respect to Oracle products. Based on that, you have then to decide whether investing on the JVM is a good decision or not.
Should I try to find an alternative to
Java?
Depends on what you are trying to achieve. A question like that is too broad and open ended to be answered in a meaningful manner.
Are you trying to move away from Java?
From the point of view of curiosity and diversifying my skills, yes. But were I in charge of developing a back-end product, I'd use the JVM. I might try to use Java and leverage from the 15 years of collective knowledge on the platform. Or I'd try Scala. But I would stick to the JVM.
Oracle or no Oracle, for these type of things, the JVM is the superior choice in terms of stability, scalability and wealth of knowledge. Erlang VM might be better from a technical point of view, but you would be hard press to build a talented team compared to building a similar one for the JVM.
Found an article discussing the future of Java, dated 05.03.10.
Okay, conclusion from the same link,
While the wheeling and dealing of the
corporate world rarely affect
developer communities as a whole, the
Oracle acquisition of Sun will have
far-reaching affects for years to
come. And while the profitability of
individual Oracle products may not
concern you, as a developer, the most
interesting points remain to be the:
- Combination of HotSpot and JRockit into an uber-JVM
- Unification of the Java SE and Java ME APIs
- Increased investment in JavaFX onto more platforms
- Continued integration of dynamic languages into the JVM.
I would recommend Java as a back end platform, I am currently employed with a company that specializes in software business solutions for companies, and nearly all of our work is revolved around using Java in the back end.
I am not sure if your back end is going to be web driven or not. I would say take a look at using the Spring Framework with Hibernate Database support. Spring has excellent support for using Hibernate and so many other tools and thats why I am a supporter of it. Unlike some other frameworks that limit you to using only certain tools, Spring does a great job of allowing you to integrate many different libraries, tools and frameworks with it. This is good because as we know too well, technology is always changing and something that is popular now, may need to be changed in the future.
Java as a back end solution will require a little more work in the beginning as oppose to lightweight approaches like Rails, but once you get everything setup(database,build files,etc) then it is off to the races.
If you end up taking the Java route, look into using Maven for building. Ant is also good, just a little more work to setup.
... did you rule out any particular technologies and for what reasons? Is .Net an option?

Struts vs Zend ? Java vs PHP? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know it's a hot question that need anwsers ^^
From my viewpoint, using Java vs PHP, is nowadays a problem of system resources (Hardware, Software, etc.).
For Java, you have to deploy J2EE Stack (JDK, AppServer, etc.) (~200M) on your server, for PHP you need to deploy a LAMP system (~100M).
Using Java was in my opinion due to object oriented programming in web application, but today we have a lot of Object Oriented Web Language (Ruby, Python, PHP).
So the question when to choose between Java or PHP for new projects ? Maybe the community difference ?
I know that stackoverflow is not made for discussion, but it's a (good?) question that need answers (for me and for others maybe) ^^.
What are you guys talking about....
Okay JAVA has some pros, but it also has some cons. Now with PHP it is exactly the same, it has some pros, but it also has some cons.
People who say PHP doesn't have a good OO environment, well either does javascript! And really that is the heart of all web 2.0 projects; javascript. The back end today is becoming more of a resource for the front end. What you can do in JAVA now days you can do in PHP 5.3 - to some degree. If you are a good developer you will be clever enough to abstract your design to make it maintainable and if you are brillant you can match and even improve object sharing in PHP, which majority of web "designers" don't know about - or dare I say, comprehend. Check this article out by O'Reilly ON JAVA!.
I develop both in Java and PHP. I'll always use PHP for my server side and I'll use Java for Android Development, and desktop development. (By the way I have developed in java for backend development, but it take twice as long to do something in JAVA then to do it in PHP. That is why I stick to PHP.
I hear this spagetti code problem with PHP all the time. Yeah. Maybe 5 years ago! If you project ends up like this then the person, or you, is a poor programer, and you should stick to drawing pretty pictures. It is easy to separate your logic from presentation, and it is also simple to separate your business logic from you data layer. Think before you code. Don't just open up a note pad and start typing. Plan! People who fail to plan, plan to fail! Jacco you're on the money!
I see uni students all the time building code where I think, "The person who is going to end up with this guy is going to regret it". If the student just planed and documented what he was going to do then every thing would be organised and ready for scaling - again if he was good enough.
Both technologies are great and you should use what is more comfortable to you or your developers. If you go down the road where you think one is better than the other and you know nothing about that technology, well guess what? No matter what you do your projects outcome will be missed, and you'll end up having to do it again.
Other constraints are usually taken into account. Things like
development time,
maintainance cost of the codebase
availability of qualified programmers
salary cost for available qualified programmers
to name a few.
Hardware and software are cheap if you compare them to the above so they tend to be less important.
I did a non-scientific performance comparison of J2EE and PHP. The comparision was to see the user experience of each system under various load conditions.
I found that PHP's response time was very slow and CPU maxed out very quickly. I understand there are some compilers that will probably help, but I wanted to make an out of the box comparison of performance of rapid development systems.
You can read the full details here: PHP vs J2EE: a Practical Approach
It depends on what you're doing. Choosing a language/framework without analyzing your project requirements is a bad idea.
Choosing a language depends on what you want to do, But I am very sure that the different hard disk space requirement will be the least important aspect of your decision.
Here is a possible hint: If you want to reuse your work (or parts of it) in a desktop application, Use Java. PHP is virtually non-existent for everything except web programming.
I really don't think that it is a question that can objectively be answered. In the end it is about people and what they feel more comfortable with. That is why e.g. Facebook developed a PHP to C++ compiler (with which the performance benefit that Java has might become smaller, too) instead of just hiring C++ developers for doing the Job.
On the other hand, the Java platform offers some interesting new approaches like Grails (which is basically a Groovy Wrapper around Spring) and Lift, as well. That makes Frontend development faster and easier (I still find that this is a real pain with plain Java) and you can combine the benefits that other languages have with your existing Java codebase and expertise (btw. most of the Frameworks mentioned don't need a J2EE runtime environment a simple Tomcat installation with around 5M and an installed JRE should be enough). So it is not really about the Java programming language alone anymore.
And if you really can't decide at all you just run PHP in Java (works as well for Ruby, Python, Javascript ...).
PHP wins in front end in web development. Because it has much smaller development time which make things cheaper and cheaper.
PHP will lose in mobile app development. There is no way to develop a mobile app front end with PHP. And Because its performance gap with java and other static languages, PHP will lose the back end battle. Java is old, but it has a pretty young and professional community. Check out those names: lucene, weka, hadoop,scala,cassandra, hbase, what does php provide us in back end service???????
I do not really agree on the fact that the choice of a language is related to system resources.
Hardware is cheap and we are not in a time where we need to closely look at the system resources as we used to have. Don't misunderstand me: we still do need to pay attention, but the time where people were xoring their pointers to save some space is over (luckilly).
And if your main concern is performance, then either running a JVM or an interpreted language is probably not the best option.
I do not think it is related to the orientation of the language per se either. Ok, I know, PHP is not object oriented but still, you can now code OO with it. You will find descent web frameworks for almost any language.
I agree with Jacco on his list.
Another aspect is indeed the culture the language refers to.
PHP is for script kiddies. Java is for serious, wearing suits business developers. Of course, we all have many counter examples but still. Java was largely adopted by big companies, now competited by .Net. There are good reasons for this, among which the fact that it a lot easier to write poor code in PHP than in Java (and almost any other language). On the other hand, Java is not exactly freedom oriented.
If your project is strictly personal, you can choose whatever suits your tastes better. If you plan to develop as a team, the choice of the language will impact its general mood/way of thinking.
I would finally add some important parameters to me: fun and elegance
This may be a matter of taste here again, but I have much more fun coding in python than in C# for instance.

When is Java the right choice for Web-based applications [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been doing some research into taking my programming experience and moving into the java programming marketplace, due to a combination of personal interest and local market forces. As you can gather from the title, the vast majority of my experience has been in building web-based sites and applications, and I'd like to move as much of my previous experience as possible.
One thing that I've been unable to find a concrete answer for when should a website or web-based application designer look to going with a Java based solution, over other options currently on the market. What options would Java provide that would have a designer select Java as the basic coding language to base a project upon?
Thank you for any constructive replies that may arrive from this inquiry.
EDIT: I should have included the caveat of if other factors are equal, for example if hardware, software, developer skill in java is up to where they should be for such projects, and so forth.
The main factor is what your developers are adept in. If you've got a bunch of Java developers, go with Java.
Consider this also: Java tends to run on app servers where there is a persistent global program running, and separate threads/processes spawn off to service individual requests. However, if the main global VM croaks for some reason, your whole app can go down. The benefit of course is that you get application/system level resources that you can initialize and use continuously across all requests
Other environments like PHP basically tear down and rebuild the entire environment for each request. You can code in application level data persistence using a database, but you don't get it for free. On the other hand, if one php process croaks while processing app data, it won't kill the whole system , as the entire environment is just torn down/rebuilt for the next request.
Agreed with many of the previous posters, but one possible consideration is runtime speed.
If you are using a very basic LAMP stack server, running PHP4 or lower, Python or Perl, if you do not set pre-compilation, all of your scripts will have to be re-compiled at runtime. This can cause immense stress on the server for high intensity applications. If you're in the situation where you cannot enable pre-compiling for LAMP, but you can for Java (most Java servers require this), then this should be of concern. The disadvantage is that you may have to re-compile large chunks of your web application every time you edit it. I realize this is becoming less and less of an issue nowadays, but its something to check.
Be sure to include a learning curve in the development time if developers aren't familiar with the chosen language.
For the most part, the best technology is the one you are already using.
If you have coders that know java, have system administrators that can configure java apps and know what to do when a java app stops working, and project managers who know how to accurately schedule and plan a java deployment, you would need a very, very compelling reason to pick something else like .NET for a new project, even if .NET is "better" (whatever that means).
There are, of course, exceptions; if you're using something obsolete and/or is not going to be supported in the future (like classic ASP), or you have no legacy systems, then it's time to use something new.
I believe that the conventional wisdom on this subject is that Java is better suited to very large systems that need the discipline of static typing. Also, on very busy sites, Java can use less memory and run faster than most interpreters.
(Right out of the box, Java wants lots of memory. But on a busy system Java has only one copy of all running code.)
There are also certain prosaic reasons to stick with Java, for specific sites. They might need back-office integration or some other big piece of existing code.
I would use Java if there was a library or framework that provided specific features that no other language did (or not as well).
For example, if I had an in-house-built java library for running our Gruntmaster rock crusher, then it naturally would make sense to use Java to build an app that needed to control the Gruntmaster.
Some might say that whatever one's shop's official language is the language one should use--I disagree with that rule, as in my experience a good developer can learn any language.
There is no hard and fast rule otherwise; each language has its own strengths and weaknesses. The fact that you are asking this question about Java tells me that you are not as familiar with it.
I'd suggest you go ahead and build an app or three in Java -- then you'll know. :)
There is very little separation between the capabilities of the various technologies available today for web programming.
Java at one time was the default choice since it far surpassed the abilities of the competing technologies, but that is no longer true.
The Microsoft answer has matured rapidly; the days of classic ASP are far gone with .Net now providing all the abilities and ease of programming that Java has offered.
New languages such as PHP and Ruby have arrived or become much more mainstream, and are also valid choices based on your programming needs.
So as many others are saying it boils down to what language you or your developers are familiar with.
Another aspect to consider, is the ability to use a vast eco-system of open source libraries.
Languages like PHP, Perl or Ruby have such lib market places (almost) built in. .Net is rather closed in that sense. Java on the other hand has a a very large, enterprise grade eco-system of libraries to choose from and communities to learn from as well.
Practically I agree with the guys about leveraging existing human infrastructure.
Technologically, Java is quite good for non-standard web things - like heavy use of AJAX (GWT, DWR, Comet spring to mind), Mobile (where you generally need lots of session data and less front-end bling), really simple things that are going to be put under immense load (it will definitely trounce Apache mod_XXX every time, the only thing faster in wide-spread use is native code).

Categories

Resources