Hi This is more of a general design ques rather than Java ques
Presently I need to make a web application similar to stock broking application. i.e. when a user logs in .. he will be seeing a set of 50 records ( stocks ) which are read from a db and shown on ui. Now there is a perl utility in backend that is changing these 50 records ( stocks ) based on some business logic I want to make a UI thats "real time" some kind of observer pattern for each record ( stock ).
As soon as the record ( stock value ) changes it should be updated on ui. I dont want to go with the old way of "pooling" thats dont want to refresh the whole screen after 5 seconds or so ... One more thing i have to use java ( jsp , jsf , applets etc ) ... I am looking forward from suggestion from you guys how can i make such an application .. high level architecture ...
Looking forward for a healthy discussion to learn from your experience. Regards Lavnish
> Hi > This is more of a general design ques rather than Java ques
> Presently I need to make a web application similar to stock broking > application. i.e. when a user logs in .. he will be seeing a set of 50 > records ( stocks ) which are read from a db and shown on ui. Now there > is a perl utility in backend that is changing these 50 records > ( stocks ) based on some business logic I want to make a UI thats > "real time" some kind of observer pattern for each record ( stock ).
> As soon as the record ( stock value ) changes it should be updated on > ui. I dont want to go with the old way of "pooling" thats dont want to > refresh the whole screen after 5 seconds or so ... One more thing i > have to use java ( jsp , jsf , applets etc ) ... I am looking > forward from suggestion from you guys how can i make such an > application .. high level architecture ...
> Looking forward for a healthy discussion to learn from your > experience. > Regards > Lavnish
Real-time == sockets, but it depends on server load - number of simultaneous clients, maybe NIO sockets...
> On Sep 5, 12:30 pm, inquisitive <lavni...@gmail.com> wrote:
> > Hi > > This is more of a general design ques rather than Java ques
> > Presently I need to make a web application similar to stock broking > > application. i.e. when a user logs in .. he will be seeing a set of 50 > > records ( stocks ) which are read from a db and shown on ui. Now there > > is a perl utility in backend that is changing these 50 records > > ( stocks ) based on some business logic I want to make a UI thats > > "real time" some kind of observer pattern for each record ( stock ).
> > As soon as the record ( stock value ) changes it should be updated on > > ui. I dont want to go with the old way of "pooling" thats dont want to > > refresh the whole screen after 5 seconds or so ... One more thing i > > have to use java ( jsp , jsf , applets etc ) ... I am looking > > forward from suggestion from you guys how can i make such an > > application .. high level architecture ...
> > Looking forward for a healthy discussion to learn from your > > experience. > > Regards > > Lavnish
> Real-time == sockets, but it depends on server load - number of > simultaneous clients, maybe NIO sockets...
GArlington wrote: > On Sep 5, 1:06 pm, GArlington <garling...@tiscali.co.uk> wrote: > > On Sep 5, 12:30 pm, inquisitive <lavni...@gmail.com> wrote: > > > Hi > > > This is more of a general design ques rather than Java ques > > Real-time == sockets, but it depends on server load - number of > > simultaneous clients, maybe NIO sockets...
Hi Guys Thanks for the quick response ... @Andrew I cant use Tibco for sure for this , wont get managerial approval for using it. Lets break up the problem I have a table in db lets stay STOCK_QUOTES having two cols STOCK and VALUE having three records stock1 , $1 ; stock2 , $2 ; stock3 , $3... now through a perl utility stock1 value is updated to $1.5 .... NOw i want to show the new value on this UI ... so the ques reduces to .. how does my UIBean get this new value .. UIBean will be notified by JDBC ... so ques reduces to how does JDBC gets this new value ...
after the above two ques are solved we can think how the UIBean will update the view layer ( as it will be dependent on the technology used on View layer ... JSP , ajax , JSF , Appleets etc ) BTW i have the freedom of using any of them
PLs let me know if i am thinking in right direction ?? @GArlington .. how do i use sockets to get the message to UIBean ?
I know that there are types of resulset ... updatabale .. but how do i get that info one / two records are change .. and how do i send the message to UIBean .. and the UI
inquisitive <lavni...@gmail.com> writes: > Lets break up the problem > I have a table in db lets stay STOCK_QUOTES having two cols STOCK > and VALUE having three records stock1 , $1 ; stock2 , $2 ; stock3 , > $3... now through a perl utility stock1 value is updated to $1.5 > .... NOw i want to show the new value on this UI ... so the ques > reduces to .. how does my UIBean get this new value .. UIBean will > be notified by JDBC ... so ques reduces to how does JDBC gets this > new value ...
Your database may have the capability of registering Java triggers that are called whenever a value is changed. Unless your application is really low volume, though, you won't want to use that approach.
What you need to do is get the database out of the critical path of the transaction. The system of record should be an in-memory data grid of some sort. If you use a JavaSpace, for example, you can notify the presentation layer when a change occurs and update the database asynchronously (and possibly in batch mode). The advantage of a space or IMDG approach over queues or pub/sub is that the information remains available for as long as necessary, so not all clients have to be up and running simultaneously.
> after the above two ques are solved we can think how the UIBean will > update the view layer ( as it will be dependent on the technology > used on View layer ... JSP , ajax , JSF , Appleets etc ) BTW i have > the freedom of using any of them
Ajax will probably be your most lightweight option, but you may get a better UI from applets or even something like Adobe Flex.
Regards,
Patrick
------------------------------------------------------------------------ S P Engineering, Inc. | Large scale, mission-critical, distributed OO | systems design and implementation. p...@spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
On Sep 5, 1:17 pm, marlow.and...@googlemail.com wrote:
> GArlington wrote: > > On Sep 5, 1:06 pm, GArlington <garling...@tiscali.co.uk> wrote: > > > On Sep 5, 12:30 pm, inquisitive <lavni...@gmail.com> wrote: > > > > Hi > > > > This is more of a general design ques rather than Java ques > > > Real-time == sockets, but it depends on server load - number of > > > simultaneous clients, maybe NIO sockets...
> > Did not finish that: OR UDP...
> Real apps use Tibco Rendevous :-)
> -Andrew Marlow
By the look of it Tibco Rendevous IS using UDP multicast...
On Sep 5, 6:01 pm, Patrick May <p...@spe.com> wrote:
> Your database may have the capability of registering Java > triggers that are called whenever a value is changed. Unless your > application is really low volume, though, you won't want to use that > approach.
My application will be of high volume or may be reasonable volume...
> What you need to do is get the database out of the critical path > of the transaction. The system of record should be an in-memory data > grid of some sort. If you use a JavaSpace, for example, you can > notify the presentation layer when a change occurs and update the > database asynchronously (and possibly in batch mode). The advantage > of a space or IMDG approach over queues or pub/sub is that the > information remains available for as long as necessary, so not all > clients have to be up and running simultaneously.
Seems logical soln should be "in-memory data grid of some sort". I dont know JavaSpace probably now is the time to have a look. Mine will be a readonly UI ... kind of monitoring appl ... so i just need to send the UI a col has changed... dont need to update db as user cant modify the records from UI ..
> Ajax will probably be your most lightweight option, but you may > get a better UI from applets or even something like Adobe Flex.
yeah which UI layer to use i have left it as of now ... will come to it later .. but ideally it should have the capability of updating each row in a table ( or treetable ) rather than updating whole table... may best is to make all three and benchmark them ..
> ------------------------------------------------------------------------ > S P Engineering, Inc. | Large scale, mission-critical, distributed OO > | systems design and implementation. > p...@spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
inquisitive <lavni...@gmail.com> wrote: >Hi Guys >Thanks for the quick response ... @Andrew I cant use Tibco for sure >for this , wont get managerial approval for using it.
Then have a look at Elvin <http://www.elvin.org/>. There are some open source implementations although the major developers are working on a commercial application using the protocol.
inquisitive <lavni...@gmail.com> writes: > On Sep 5, 6:01 pm, Patrick May <p...@spe.com> wrote: >> What you need to do is get the database out of the critical >> path of the transaction. The system of record should be an >> in-memory data grid of some sort. If you use a JavaSpace, for >> example, you can notify the presentation layer when a change occurs >> and update the database asynchronously (and possibly in batch >> mode). The advantage of a space or IMDG approach over queues or >> pub/sub is that the information remains available for as long as >> necessary, so not all clients have to be up and running >> simultaneously.
> Seems logical soln should be "in-memory data grid of some sort". I > dont know JavaSpace probably now is the time to have a look. Mine > will be a readonly UI ... kind of monitoring appl ... so i just need > to send the UI a col has changed... dont need to update db as user > cant modify the records from UI ..
That makes it easier, although you still won't want to drive the updates from database triggers if the load is even minimal. The number of hops required and the disk access will be prohibitive.
Regards,
Patrick
------------------------------------------------------------------------ S P Engineering, Inc. | Large scale, mission-critical, distributed OO | systems design and implementation. p...@spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)