Results 1 to 5 of 5
Thread: Time constraints on object state
- 04-10-2009, 07:18 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 2
- Rep Power
- 0
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.
- 04-10-2009, 08:11 PM #2
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...
- 04-10-2009, 09:51 PM #3
Just another cross poster.
Java Programming - Time constraints on object state
db
- 04-11-2009, 03:40 PM #4
Member
- Join Date
- Apr 2009
- Posts
- 2
- Rep Power
- 0
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.
- 04-11-2009, 06:12 PM #5
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
Similar Threads
-
how to pass an arraylist from an object back to the parent object that it was created
By george_a in forum New To JavaReplies: 1Last Post: 03-04-2009, 06:14 PM -
Checking toggle state of a menu item
By xsive in forum SWT / JFaceReplies: 1Last Post: 09-22-2008, 02:42 PM -
I have problem in parsing state machine diagram
By Saniya in forum EclipseReplies: 0Last Post: 06-10-2008, 07:37 AM -
Concurrent Hierarchical State Machine 4.3
By levent in forum Java SoftwareReplies: 0Last Post: 08-03-2007, 04:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks