Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2009, 08:18 PM
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
Flipke is on a distinguished road
Default Time constraints on object state
I'm working on a project and I've come across a new thing I'm really new at. I've checked forums, but basicly, I don't know what to look for. I’ll try to explain it as simple as possible and give you an example of what we have to implement.

The project consists of builing a platform for a company to administrate contracts, transport requests etc. Each contract has, amongst other attributes like “contract period”, a ContractState, using the state pattern. States could be PROPOSED, SIGNED, EXPIRED, etc. We’re not using any kind of database for this, all contract objects are stored in a simple ArrayList.

So an example of what we’re trying to achieve is that when the time hits ‘creationdate + contract period’ for any contract, that contract’s state automatically changes to EXPIRED. On top of that, we have to be able to jump forwards and backwards in time during execution, for demonstration purposes. We’re thinking about making a clock, relative to the real time by adding or deducting a set period and maybe using an Observer pattern.

What is the best way to implement this?

Any tips could be of great help,
Thanks in advance.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-10-2009, 09:11 PM
markw8500's Avatar
Senior Member
 
Join Date: Jul 2008
Location: Pennsylvania, USA
Posts: 136
Rep Power: 0
markw8500 is on a distinguished road
Default
Will your contract's be expiring by the day or by the minute...

Example of by the day would be like an apartment lease... It will expire on a certain day and hours, minutes do not matter...

An example of hours/minutes/seconds would be an e-bay auction...

Also... If you do not store your data in some type of database/filesystem then everytime you shut down your program, all your data will be lost... You might want to reconsider that...
__________________
Who Cares... As Long As It Works...
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-10-2009, 10:51 PM
Darryl.Burke's Avatar
Senior Member
 
Join Date: Sep 2008
Location: Madgaon, Goa, India
Posts: 726
Rep Power: 2
Darryl.Burke is on a distinguished road
Default
Just another cross poster.
Java Programming - Time constraints on object state

db
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-11-2009, 04:40 PM
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
Flipke is on a distinguished road
Default
The contract expires by minute, every date stored includes hours and minutes.

We currently have no database because it's a project for school. It's a rather large one, but the emphasis lies not on how to store/query/.. data in a database, but on object oriented programming. A "world" is created each time you execute, which you can then manipulate through given use cases.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-11-2009, 07:12 PM
Senior Member
 
Join Date: Sep 2008
Posts: 564
Rep Power: 2
emceenugget is on a distinguished road
Default
you got your answer in the other forum. not exactly a new concept that requires research, just a basic one that requires application.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass an arraylist from an object back to the parent object that it was created george_a New To Java 1 03-04-2009 07:14 PM
Checking toggle state of a menu item xsive SWT / JFace 1 09-22-2008 03:42 PM
I have problem in parsing state machine diagram Saniya Eclipse 0 06-10-2008 08:37 AM
Persisting state of objects JavaForums Java Blogs 0 12-11-2007 06:20 PM
Concurrent Hierarchical State Machine 4.3 levent Java Announcements 0 08-03-2007 05:44 PM


All times are GMT +2. The time now is 03:28 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org