• Post Reply Bookmark Topic Watch Topic
  • New Topic

several desktop apps connected to one MySql db  RSS feed

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i posted somewhere else, but as no one replied, guess was the at wrong place.
i'm not sure if this is the right place, so here i go
i'm very new to java (just finished understanding interfaces), but i like to dream.
Actually i'm developing a web application ( with php+MySql+Apache) where users fill lots and lots of forms. Those values are stored in Mysql. Other users will work on that data, editing, updating or deleting it, and then fill other forms.
I know for sure that i've to understand oop basics, command line JDBC and swing to make this kind of functionality with java in a desktop app.
i gave a look at jdbc and it looks quite easy to me.
i also studied a sun java tutorial about building a gui interface (DiveLog tutorial) with read/write from files, check boxes, text area, buttons and so on.
So my Q is: what kind of another technology will i need to master in order to have an equivalent aplication, but in this case with desktop interface instead of web browser?
Can i simply connect the various desktop apps (all identical - one per computer), in diferent machines, to the same MySql database without further things (like web services or RMI (not sure exactly what this is)...)?
Thanks in advance
 
Nigel Browne
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the sounds of your discription you are attempting to build a 2 tier distributed system. To be able to do this I would recommend you use RMI (remote method invocation). The other option you have is using sockets, but once you understand the RMI you will see that there are many advantages to it's usage.
A robust distributed system should take into account matters such as connection pooling, database locking, transaction rollbacks e.t.c. Spend time designing the system before building, by your discription of what you want to achieve, the MVC pattern should be used. Son that presentation, business logic and data are clearly seperated and remember to unit test your components.
Regards
Nigel Browne
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your reply, Nigel
By the sounds of your discription you are attempting to build a 2 tier distributed system.

Well, i heard 3 tiers, separating presentation, business logic and data is the best...
A robust distributed system should take into account matters such as connection pooling, database locking, transaction rollbacks e.t.c.

I'll study connection pooling (where?);
i guess database lock its done directly in MySql, but not sure;
as to transactions, my app has very small needs - just some data to input - that i guess they wont be needed
Spend time designing the system before building

I'll even enjoy it
Some Qs, please:
1) Because all users are using the same front end, from diferent machines, (inserting, adding and so on to the same db), will rmi solve my prob?
I mean, i thought simply connecting those apps to central MySql database would solve the problem..., but i'm very ignorant in these matters...
2) What's MVC pattern?
thanks again
 
Nigel Browne
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Some Qs, please:
1) Because all users are using the same front end, from diferent machines, (inserting, adding and so on to the same db), will rmi solve my prob?

I am by far an expert on mySql, but in general setting up and tearing down database connections is a costly process and it is far better to create a connection pool to which you clients connect. RMI allows for a central set of business logic to be shared amongst all of your clients. By the way the reason I called your application 2-tier rather than n-tier, is because you are not using an application server.

2) What's MVC pattern?

Have a look at this article
regards,
Nigel
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way the reason I called your application 2-tier rather than n-tier, is because you are not using an application server.

By no means i'm doubting of what you'r saying, but on a second reading, i wonder if i need it - application server. Do i?
thanks again
[ February 23, 2004: Message edited by: miguel lisboa ]
 
Nigel Browne
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having an application server in the architecture, will obviously add complexity to the system. The question to be asked is how the system will be used. Will it need to be load balanced, what are the security issues, will there be more than one type of GUI using the business objects e.g Web frontend and desktop frontend e.t.c
After answering these questions you can then make a informed decision on wether the cost of an application server is justified or wether a more simple approach is sufficient.
Nigel
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm... from what i'm understanding there's no unique path to my dreamed app. Depends on what i want from it; well, i'll keep on studying and then later on for sure i'll be back with more concrete Qs.
thanks for your answers
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!