• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Design pattern needed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am going to develop a tool, that will do the following,
collect the files from remote server - periodically every few minutes.
Export the collected files into a one single file.

my idea is that the above 'collect' and 'export' action is like 'producer' and 'consumer'.
So can i use 'observer' pattern to implement the above actions?
if not please tell any other design pattern.

Regards,
Kannan DV

 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe its not the observer pattern in this case,

If the action of collecting files is just on time interval, then i don't see any design pattern here,
if the action is based on factor like the server is intelligent to say that the files have been changed and so the client can access it:

Regular polling:
1. Client can 'poll' the server after an interval, if server responds a "yes" client can then initiate file transfer session.

Modified version of polling:
2. Client sends a poll, but server does not respond immediately but after a specified time interval, if files are changed, it sends a "yes" or a "no" - requires thread running at the server.
3. Client sends a poll, server discards the request if nothing has changed. Client gets a time out after a long interval and re-sends a poll. if something has changed, server returns a "yes".

There was a name for this special type of polling, it does not come to mind right now...
 
kannan vinayagam Duraiswamy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from client every 5 or 10 mins, it sends request to the server.
Then server sends a list of files.
This part is 'collection'.
After 'collection', 'export' need to be done [consolidate all files that have been collected during the 'collection' period].

Any further idea ?

Regards
Kannan DV
 
Marshal
Posts: 79979
397
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a "beginning" question. Moving thread.
 
BWA HA HA HA HA HA HA! Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic