• 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

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: 2880
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: 73751
332
  • 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.
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic