• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server UI

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What did you guys implement for your server UI?

I provide a UI with

database location, magic cookie and port No.

the user can click start and it will validate all the fields and start the RMI server.

is pretty simple actually.

Should I provide the IP address of the server after clicking starting RMI server?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I provided database location, port number, start and stop buttons. Nothing more, nothing less.
 
Ranch Hand
Posts: 101
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Three labels
1. SERVER RUNNING...
2. LISTENING ON PORT: XXXXX
3. DATABASE LOCATION: \XXXXX\XXXXX\XXXXX\xxxxx.db

Then I added a QUIT button below it.
Simple and pretty.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Oladeji Oluwasayo wrote:Three labels
1. SERVER RUNNING...
2. LISTENING ON PORT: XXXXX
3. DATABASE LOCATION: \XXXXX\XXXXX\XXXXX\xxxxx.db


If you are showing just 3 labels containing the port and database file location, how can I (as a user) change the location of the database file? Seems a weird Server UI to me...
 
Ranch Hand
Posts: 54
Eclipse IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mine starts with a dialogue box allowing the user to choose a file and network port. After confirming these settings it just shows the network port and a file/exit option. I tried to have a start and stop but had problems with stopping and starting the rmi server. I took the easier option and got rid of them
 
Ixus See
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I assume on exit you just do system.exit(0) ?

will the RMI server stop? Will I have problem restarting the RMI server there after?

Will that affect anything?
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are things you can easily find out yourself.
 
Oladeji Oluwasayo
Ranch Hand
Posts: 101
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

Oladeji Oluwasayo wrote:Three labels
1. SERVER RUNNING...
2. LISTENING ON PORT: XXXXX
3. DATABASE LOCATION: \XXXXX\XXXXX\XXXXX\xxxxx.db


If you are showing just 3 labels containing the port and database file location, how can I (as a user) change the location of the database file? Seems a weird Server UI to me...



Oh Roel, I provided a configuration dialog (a configuration dialog reused by the client and stand-alone modes too) prior to displaying the main window for the server. It has a field for entering the database location, a "browse" button, a field for specifying the server port, labels for the text fields, start and cancel buttons. After clicking start, the dialog disappears and the window i described earlier is displayed.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's also a commonly used approach. But now it makes more sense than just a window with 3 labels
 
Ixus See
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I notice the RMI codes are less than 10 lines(both server and client) add together...

registry
rebind
lookup

basically is these 3 api calls, did i miss out anything important?
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ixus See wrote:basically is these 3 api calls, did i miss out anything important?


Does it work?
  • Yes, then you didn't miss anything important.
  • No, then you did miss something.
  •  
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:

    Ixus See wrote:basically is these 3 api calls, did i miss out anything important?


    Does it work?
  • Yes, then you didn't miss anything important.
  • No, then you did miss something.


  • it works.. but just a bit worried when things requires little effort =X

    I guess i am pessimistic :P

    Thank you once again

    I have some problem with naming convention

    I name the class accessing Data.java as RoomDAOImpl (implements roomdao

    and the class to locate/create roomDao as service factory

    basically I use it to register in RMI.. I got a feeling they should be call RoomService and Service Locator
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:I got a feeling they should be call RoomService and Service Locator


    I think the class accessing the Data class should indeed be renamed to RoomService, because your Data class is actually the RoomDaoImpl.
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:

    Ixus See wrote:I got a feeling they should be call RoomService and Service Locator


    I think the class accessing the Data class should indeed be renamed to RoomService, because your Data class is actually the RoomDaoImpl.



    That was my initial idea.. but somehow I feel data should be like your database methods which you call to access data...

    and there is another layer call DAO.. maybe is just me, I strongly opposite calling DATA.java as a dao because to me is a lousy database sequel layer(can't remember the word for it) , which one day I am going to replace with SQL database and then I will use my RoomDAO to access it~

    anyway I already refactor it~

     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In a DAO interface you'll have some CRUD-methods, probably also one for searching records. The only methods you won't have in the DAO would be lock, unlock and isLocked. But to me your Data class is accessing the data, so it's a DAO and it's accessing the data from the file system. So Data is an implementation for accessing the data from the file system. Another implementation of the DAO could be a RoomDAO which access the data from a RDBMS.
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:I notice the RMI codes are less than 10 lines(both server and client) add together...

    registry
    rebind
    lookup

    basically is these 3 api calls, did i miss out anything important?



    hmm anyone use RMI here? What did you implement beside just registry -rebind for server and look up for client...

    how do you guys validate RMI port?

    is really too little work for 40 marks
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You also have your server implementation of course that's part of the Server section
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:You also have your server implementation of course that's part of the Server section



    heehee of cos I have that..

    anyway is there a range of ports no. for RMI?



    why does the interface DB and data.java mention under the section of server?

    I use room service as the remote object, not data.

    am I doing something wrongly?
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:why does the interface DB and data.java mention under the section of server?


    Maybe because it always runs on the server (unless in standalone mode of course)

    Ixus See wrote:am I doing something wrongly?


    Have a look here.
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I'm still a bit blur...

    lets say I have IRoomService and RoomService(implements RoomService)

    and in my room service, I have find, get, update and delete..(the locking/unlocking is done in the update and delete).


    1) I can assume that the locking is done on the server side? since my remote client only calls the remote object? will I be penalize for that? I read someone lost 36 marks because of that.

    2) I also do the filtering of result in the find method, I am thinking of moving it to the model that calls the roomservice. but that would incur cost since each find method needs to go through network again rather than performing the operation on server side.
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:1) I can assume that the locking is done on the server side? since my remote client only calls the remote object? will I be penalize for that? I read someone lost 36 marks because of that.


    Sounds weird to me. Maybe his design/code had some flaws/bugs. I 've done exactly the same and was not penalized at all.

    Ixus See wrote:2) I also do the filtering of result in the find method, I am thinking of moving it to the model that calls the roomservice. but that would incur cost since each find method needs to go through network again rather than performing the operation on server side.


    What's your motivation for moving filtering results to the model instead of doing it in the service method itself?
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:What's your motivation for moving filtering results to the model instead of doing it in the service method itself?



    because I feel the filtering is a business logic and the service should focus on doing its job(communicating with data.java). but anyway I think i will put it on the server, because it will reduce over head cost of performing the operation and if there is a change in business logic, the client doesn't need to change and all I need is to update the service/server
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:the service should focus on doing its job(communicating with data.java)


    So you are developing a fat/thick client and the service does not expose business methods (like bookRoom), but similar methods like in the Data class (find, read, update, lock, unlock,...)
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:

    Ixus See wrote:the service should focus on doing its job(communicating with data.java)


    So you are developing a fat/thick client and the service does not expose business methods (like bookRoom), but similar methods like in the Data class (find, read, update, lock, unlock,...)



    well it seems that i shifted to a thin client.

    and my services expose only bookRoom and deleteRoom and find room.

    why bookroom? it is because after obtaining the lock. the service have to check if the room has been book(CustomerID.isEmpty) before updating it.

    find room will package the result into a vector of rooms which matches the UI search requirement.

    deleteRoom juz do deletion ;) *not a requirement* I just want to prove that the JTable only shows valid records without the examiner looking at the codes.

    Helping your marker helps you to score some points too
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:well it seems that i shifted to a thin client.


    So you answered the question about the appropriate location to add the logic to filter records yourself.
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Roel De Nijs wrote:

    Ixus See wrote:well it seems that i shifted to a thin client.


    So you answered the question about the appropriate location to add the logic to filter records yourself.



    I did but I want 2nd opinions and maybe things i miss out. I always believe a 3rd person view is the clearest ;)

    Thats why my encourage my colleagues, if you can't solve a problem in 1 hour please SEEK FOR HELP, because a 3rd person view will help a lot and you won't be wasting man hours. Maybe I strongly believe that a lot of problems my colleagues face are already solved in design patterns and no point re-inventing the wheel. I also encourage more communication and healthy debates, which is what I hope to see.

    Don't you feel a lot of software engineers are very "closed"? They don't take much especially regarding their design as holy book that cannot be disputed. Anyway is just my way of encouraging more sharing, caring and learning in the work place.

    How about you, Roel De Nijis? how do you encourage your colleagues to share and talk about their work and problems?

     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    heehee of cos I have that..

    anyway is there a range of ports no. for RMI?
     
    Chris Zaremba
    Ranch Hand
    Posts: 54
    Eclipse IDE Spring Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    See RMI Port Number
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:anyway is there a range of ports no. for RMI?


    ShowSomeEffort
     
    Ixus See
    Ranch Hand
    Posts: 160
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Chris Zaremba wrote:See RMI Port Number



    yes obviously I know the default number is 1099, but that doesn't mean the user will only choose 1099 or maybe his port is block.. I allow the user to set a different number.

    Now the problem is to validate if it is a valid port no.

    I check if it is digit. . but what about the range of valid numbers?
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Likes 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ixus See wrote:what about the range of valid numbers?


    I was able to find the answer using the search engine of this forum. So I would suggest giving that a try. Don't be afraid: it won't hurt you
     
    If you're gonna buy things, buy this thing and I get a fat kickback:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic