Is there a problem using Java for commercial automation application in dektop? Or is it better to do it for the web using PHP?

Asked

Viewed 2,216 times

-2

I’m developing a project for desktop using Javafx and Postgresql, but I started reading about Java and found many cons about this programming language (slow, for example), so I’m thinking about developing for web using PHP + Mysql.

The system is for general control of a mini market, which later can be used to manage two units of the same in separate locations, where it will be integrated with TEF and PDV.

  • 7

    I think no one is in favor of java! ok except legal persons.

  • Hello, your question is based on opinions, so it is not accepted on the site. In php it is not possible to develop desktop applications (except for gtk), all languages have their pos and cons, and there is only Java, for desktop try C#, or do Wb with PHP.

  • Which one would be better for this situation? a desktop application or a desktop application ?

  • It depends more on the client, can do both ways, but I see the web as a better option, because in many places the company’s machines are weak, if the desktop system does not perform well on the company’s pc the company will put the blame on the system and not on the bad pc. A Web System Wouldn’t Be This Problem, But Many Are In Doubt About the Security of a Web Application.

  • 4

    java fx serves both desktop and web. And I still believe in the precept that whoever does the bad language is the bad programmer. If you don’t "misuse" language resources, it will hardly cause you any problems.

  • I think so, but I heard that java becomes slow and it would take a computer in a certain way "better" to run the programs without crashing, is that true? java is really slow?

  • With respect to java you can tell me if it is easy to integrate tax printers and specific keyboards ?

  • Any desktop program that misuses available resources will weigh the computer down to C itself#.

  • When I talk about it, it’s not even a matter of languages, because it depends more on the developer. But when I quoted this was more in question of the user, who is usually layman, and in companies gets worse because it unites weak pc and layman, soon also binds virus + slowness of the pc = fault of the system.

  • It all started wrong when I read the phrase "What is your opinion". Maybe there was an issue for the question.

  • @diegofm have you developed any application with javafx for web? you can tell me if it is good?

  • 3

    @rray at least my legal person is not kkk.

Show 7 more comments

4 answers

29


All languages have defects. You will read up the problems of various languages in various places. If it is in a place where people like C#, they will hear very badly of Java. And the opposite is true too. I’m not saying people are telling lies. If it’s a place of good professionals, it’s probably true, maybe a little biased. Read all this carefully. Look for other sources. And generally don’t rely so much on random people on the internet.

Bad code causes far more problems than bad languages. Learn to make good code. Start with the foundation. Understand computing as a whole. Do not go in cake recipes, in such "good practices". Learn!

Most languages suit every kind of application, no matter what it does or how it fits. Your problem seems to be clear to resolve on desktop. There is no doubt about that. Java, C#, C++, Delphi, etc., all work well with commercial applications, including external automation equipment such as PDV, TEF, etc.

The existing libraries are more important than the language. I will mention some that have good libraries for the commercial automation area.

Do you know how to handle any? If you know, it should be an indication of what to use. The differences between them are small to justify the idea of "using the right tool for the problem". In this case I think that fits more the "the best tool is the one you know".

Analyzing the languages a little

PHP and web

PHP is not usually recommended for desktop. I even find it strange to jump from Java to PHP. They are very different philosophies. PHP is basically used to backend web. Forget about it.

Forget the idea of making this kind of application as web, it doesn’t work. The user experience will suffer and the integration with external equipment is from suffering to unviable.

Java

Java isn’t that bad either. If you can choose, I think you’d better choose something else, but it’s just my opinion, don’t choose because of it. Just don’t discard as a valid option. It’s not as slow as they say, it’s been a day (PHP is absurdly slower). And it has improved in every version.

If you already know her well, it may be the best option. I think she does not enjoy the GUI well. I even see the Javeiros complaining that Javafx is for some kind of very specific application. If you go that way, do more research on the subject, ask very specific questions here about the subject.

C#

If Java doesn’t suit you, maybe the choice lies on C#. I don’t know if you’ll answer either. There’s no way to say what’s good for you.

For desktop, C# works great on Windows. There are technologies that fit very well with Windows available for C#.

If you need to run on Linux, that works, but it’s not as good (although it’s not exactly worse than what Java offers). The same goes for Macos. It’s a little better for the mobile world. It is not the initial concern of this project, but it can expand and need to run on the 3 main mobile platforms.

The language is totally free, has all its open source and even the Almost complete Visual Studio is free for most situations (should be your case).

If I didn’t know anything I’d go with C#. But backup, it’s personal taste.

C++

Some would recommend C++, but it is not for beginners. Using the Qt it is better if you need the application to run on multiple platforms taking advantage of all the best that each one has. But I doubt that’s your case.

Some not so suitable

Others would say about Delphi, I particularly consider legacy technology, though not in fact. It’s a paid, closed language and almost no one starts new projects on it. I would only go on it if you were already very comfortable with it. Then it will even be a viable technical option for Windows (not on Linux).

I will not talk about VB that is actually legacy and if it is of VB.NET it is better to choose C#, I see no advantages.

Other static typing languages are either legacy or not mature, or do not have good desktop libraries (GUI), such as Go, Rust, D, etc.

I’m not going to talk about specific dynamic typing languages because it doesn’t seem to be the original intention. I’ve seen something on desktop using Python. I do not know the level of success, but I saw very little. A large application that I saw was not good, but it does not mean that it is the language’s fault. But it can also be. If the original intention was Java, I think this type of language will be less suitable, although technically it works.

Database

Use what suits you best or what you already have. If it’s Postgresql, use it. It doesn’t matter what language. If you have any reason to choose another, choose. These are independent decisions. All these languages work well with it, with Mysql, SQL Server, Oracle, Firebird, Sqlite (is even an option for some), among others. All work on servers.

All are or have limited versions viable for a lot of free stuff. They all run on early platforms (SQL Server for Linux is almost ready). In mobile and desktop client only Sqlite is actually viable in the client. There are those who use Firebird. But this is another subject.

Completion

If you have such a basic doubt, I would suggest trying to find someone more experienced to share the project and thus acquire the necessary experience.

  • Good friend, I like your answer ! And I’m reading here look, I go to school of information system, and I’ve already learned several languages, but the doubt is what to develop I saw that you indicated C# but it’s not free right? for me to market the software developed in C# I would have to buy the license and this is out of context so for me the idea would be a free platform, I started developing in java, more many people told me "java is slow, does not compensate" and I ended up getting in doubt,

  • The question is what to develop and you can tell me if with java is easy integration of PDV, TEF,?

  • 4

    It’s totally free and open source (https://github.com/dotnet), more cross-platform than Java, including Visual Studio is free http://answall.com/q/40609/101. People are very uninformed and keep spreading the wrong stuff around. The rest is in the answer.

  • 1

    @bigown including many people do not know that C# is ECMA ISO.

  • 2

    @Bruno This story of "java is slow, it doesn’t pay off", was true in 1997, almost 20 years ago. From there to here something changed.

  • So since I don’t have any company and I’m developing alone becomes free, that’s cool, I didn’t know, can you answer me if sqlserver, which comes along with c# tbm is free? and if you would recommend me development in WPF

  • @Bruno Again, these are different questions that need to be asked elsewhere. But yes, SQL Server can be used for free in SQL Server Express versions or Localdb (I don’t know if it will apply to Linux that only now has SQL Server), I won’t go into details. But you can continue with the DB you think best. About Winforms, WPF, UWP,.

Show 2 more comments

14

Let’s not start the old competition between programming languages. Speak ill of Java because the learning curve is large or speak well of PHP because it is not typed is not the way for your answer. Use the right language for the right problem.

You must answer this question as it suits you, but a map to get you started is:

1 - First error is GENERAL CONTROL (this does not exist) Control of what? Will it have PDV (box), Integration with TEF or is it a control simply to then be thrown away and evolve a larger project? Because if the market grows its solution will have everything?

2 - Web? No, not at all. If you run on PDV you will have many difficulties to integrate with tax printers such as Bematech, Tefs, specific keyboards etc.

3 - Free software? Will run 100% free software environment?

4 - How long design time and what functional requirements? Non-functional requirements can leave your PHP decision on the ground easily.

Anyway, someone gave you -1 on your question. These are questions that every beginner has, and if someone gave me this answer that I am giving you, I would not have broken my face in two projects that I wanted to make "quick" a "general control", at the beginning of my career.

  • 1

    Good liked your answer ! and really I had not thought of this part of integration with tax printers and specific keyboards ... The idea is not to be such a simple project, it would rely on basic functions such as supplier registrations, customers, employees, products, categories ... and would have some functional functions such as performing sale, purchase, launch accounts payable, pay and pay bills ... but now I’m in a huge doubt, the project has already been started in java and it would be necessary something totally free tbm so I did not choose to c#

  • With respect to java you can tell me if it is easy to integrate tax printers and specific keyboards ?

  • @Bruno how cool. Many people who develop for the web for example, create portals, websites, etc have no idea of the "HEADACHE" which is to develop for example an Electronic Invoice solution. for bureaucratic issues, legislation etc. That’s why my answer was focused on your problem and not on the tool. Think of the "modules" and we help you with the :-) architecture may involve a lot more language than you can imagine. Once I gave advice to a supermarket putting PROLOG to optimize the location of the products on the shelves, so you have an idea of where the thing arrives.

  • @Bruno with regard to integration with tax printers, Tefs etc, is quite easy (when I say easy is the issue of "communication" not legislation). Many companies provide ready-made Apis for this. Bematech for example has it ready for several languages: VB, C#, Java, C++ etc. Elaborate everything you have to have at least in each module and we can help you build an "architecture" to get started.

  • Good Matthew the architecture in question would have 2 interconnected computers, where 1 of them would act tbm as server! the program would run on both machines, and it would be possible to sell and buy the products containing all basic functionalities and tbm being possible to generate electronic invoice and etc! Now the main question is the LP to solve this problem, which one should I use? at first I get along well with C# and didn’t know it was possible to use it for free, until @bigown quoted in a comment below and tbm I get along with java, the intention then was to make a desktop application taking in

  • consideration of the use of a free language a sgbd tbm! it even crossed my mind to do something more web like you said becomes something more complex to do the issuance of notes and etc. well now the problem really is, which lp should I use and which sgbd?

  • 1

    Now I will answer with my opinion: an architecture that will be great at first (looks like an orchestra) but later if the market grows, have other branches can be better and you will understand according to your experience with Java. Java with Swing on Pdvs sales terminals (would not use Javafx) integrating with EJB (in EJB, JPA implementations and Mysql SGBD). Ejbs for everything. No business rule on modules in Jars and separate parts. Business rules in my Ejbs always, so maintenance is more focused on business components. All integration with Nfe with Ejbs.

  • By that you mean my rule of business is all in the bank, correct ?

  • 1

    Why do you think you should use Swing instead of Javafx?

  • @Bruno opens new questions with specific doubts, there is even a discussion in the chat about this question whether it should be closed because it is opinionated, not clear or broad. Your comments are going too far. Here is not a forum, there is to discuss the subject, new doubts will be welcomed in new questions.

Show 5 more comments

10

Well, that’s an opinionated question, but come on.

First:

but I started reading about Java and found many cons about this programming language

What cons did you think? There are several cons in fact, but all languages have their pros and cons. And there are also many people who tend to squeeze the cons to a higher level than they are in practice.

For example, there are many people out there who repeat the mantra that "java is slow". That was true in 1997. After almost 20 years, a lot has changed. Because of this, whenever you see a criticism of a language, analyze the context in which it is valid, as it is often specific cases or cases that no longer apply. Analyze when the criticism was made, based on what facts and whether this applies to your case. In addition, there are many people talking nonsense or spreading them like parrots. Be careful with this.

In particular, in the case of Javafx, it is very fast for what it proposes to do, being a good competitor compared to Flash and a very good desktop alternative if you do not want to go to a solution based on HTML5.

For example, I could make a criticism and publish somewhere on the internet that "Delphi is not good for making game animations as I tried to do this and failed miserably due to the intense flickering". However, this criticism would not be valid unless I proved that the way I was trying to develop was in fact the best (and I doubt it has been), that I would have exhausted the possibilities of the other viable alternatives (very unlikely) and that no other solution would have arisen in future time (unlikely also unless my publication was very recent and very thorough). Also, the fact that it was not satisfactory for me does not mean that it would not be for you since your problem is different from mine (your system probably does not need to use this kind of thing).

Another frequent complaint is that Java is very verbose. This is true, although changes in language such as the Java 8 Bars and some ideas that should be implemented in Java 9 are reducing verbosity. Again, it is worth looking at the historical context of criticism. And while this may be boring, it would in no way be a serious deterrent.

Finally, I say that I have seen many systems made with Java Desktop running very well. To cite a specific case, you may know the pharmacy network Drogaraia/Drogasil. Well, their system is in Java both on the client and on the server, and the client uses Swing (which is the precursor/foundation of Javafx). I am not saying that the implementation of their system is good or that it is bad, because I do not know it, but it shows the fact that this kind of thing does exist in the real world. And this system integrates with tax printer and everything.

Also, the fact that you are thinking of using for web in PHP shows another deeper problem:

How do you want the system to be used? Who will use it? Where will it be used? It is to answer these questions that you will decide whether to do it on desktop or web (or some other alternative, e.g., mobile). It is not the option for the programming language that will determine this, but the opposite.

As for the issuance of fiscal notes, if you are talking about electronic invoices (NF-e), I can say that I have worked on two different systems for the issuance of NF-e’s in Java. One was desktop using Swing and the other was web using Tomcat. In addition, I know that some state farm departments use Java web on the server side while others use C#. In general, the government’s NF-e system was (poorly) designed with Java and C# integration specifically via webservices (through WSDL and SOAP). Not that it’s not possible with other languages, and surely there must be people who managed to do this with PHP, Python, Delphi or something else, but the main focus was specifically Java and C#.

As for printing supermarket tax coupons, you can be sure that there is availability for this in almost any desktop programming language being used seriously today. For web systems this is more difficult because the tax printer is a specific hardware that will not be available for use in the browser (unless you have some crazy plugin for Chrome or something, which I find very unlikely to exist) and you want the printing to be done on the client that is in the box and not on the server. Ways to make the server communicate with the client printer will only make things unnecessarily harder.

As for the possibility that the computers can’t handle Javafx, that’s probably bullshit. Except in the case that they are actually very old (e.g., 486 using DOS and Windows 95) and cannot be upgraded in any way by making it impossible to install any decent JVM on them. I only envision as realistic hypotheses for this case a company with very old computers in the boxes that is on the verge of bankruptcy to not have money to upgrade them or simply refuse to do itit by being managed with large doses of sheer and simple negligence and stupidity (or most likely all of these factors together), and in any of these cases, you will have far worse problems to face. However, even if this is the case, anything you’re going to try to run on them will be pretty bad unless you work with a very old tech or develop a web system for Internet Explorer 6 or worse.

Anyway, if you need to use the supermarket cashier’s tax printer, I think that eliminates the possibility of using a web system. Otherwise, this possibility remains open. I’m not saying that you should or should not do in Java, but so far you haven’t shown anything that can eliminate this alternative.

  • I liked your answer, and I understood what you meant! It might be good to accomplish some things and for others not and it really will depend on who uses it! in the example quoted regarding pharmacies I know, but not the system! My system in this case would be used in a mini market, used only by the "sellers" and "administrators" in question ... but as I said I do not know if their computers are good, to run an application so I considered the possibility of being web because I know that at least one browser would support, but if it were web I would have many problems with relation

  • the issuance of fiscal notes and the like

  • @Bruno was writing a comment to answer these new questions, but it was too long and so I edited the answer. : D

3

There are already several opinions and good answers about your situation. But one suggestion I can give you is that if you are already and intend to continue developing in JAVA, I recommend using Java EE to develop your WEB project. My TCC for example was designed on top of a Java desktop application and we made a WEB version with JSP, JSTL and etc... the way to work is not so different and you can keep many business rules adapting little code for example.

If you want to see an example of JAVA EE code, my TCC is on Github. https://github.com/pedr0369/ProjetoPizzariaEureka

Browser other questions tagged

You are not signed in. Login or sign up in order to post.