Monday, October 23, 2006

Create Qualified Association in Rational Software Modeler

To create a qualified association in Rational Software Modeler, e.g. the 1 on 1 relationship between a team and a player by the qualifier of shirtNumber, follow the following steps,
  1. create the Team class
  2. create the Player class
  3. create the shirtNumber attribute in the Player class, make it "unique"
  4. create an association between Team and Player
  5. expand Team
  6. right-click on the player attribute of the Team, select Add UML > Qualifier
  7. completed
Don't be confused by the 1 on 1 multiplicity. Given the qualifier, it is 1 on 1 instead of 1 to many. Of course at the same time, a team can still contains many player.

Thursday, October 19, 2006

Insurance on Property - 2.7

a) What is the major difference between how coverage under a named perils policy and an all risks policy is determined?
b) State the types of exclusions found in all risks policies and give an example of each.

Answer:

a) A named perils form responds only to loss caused by perils identified specifically in the policy. To recover under such policy, an insured must show both that property damaged or destroyed was insured property and that the cause of the loss was a listed peril.

An all risks form insures any fortuitous loss unless the proximate peril is exclued specifically in the policy. To recover under such policy, the insured must show that the property damaged or destroyed was insured and that the loss arose from a fortuitous and not inevitable risk. The insured need not prove the loss is covered, the onus is on the insurer's side.

b) All risks policies have the following types of exlusions,
  1. Types of property; for example, money, securities, aircraft, watercraft.
  2. Types of loss; for example, loss arising from delay, loss of market, or loss of use or occupancy.
  3. Types of risk; for example, loss by misappropriation, conversion, infidelity or dishonesty of any person to whom property is entrusted.

Insurance on Property - 2.6

In a policy covering a commercial or mercantile risk:
a) In the event of a fire, what other types of damage are regarded as fire losses?
b) How is actual cash value determined when a loss occurs? What qualifer governs the calculation of the actual cash value of a loss? Why is this qualifier essential?
c) What is the effect of the automatic reinstatement clause?
d) What would be the special provisions of a Replacement Cost endorsement if used in such a policy?

Answer:

a) In the event of a fire, other types of damage are considered as fire losses in that they occurred because of the fire, that is, they are consequences of a hostile fire. Such types of damage may be,
  • caused by explosure to heat
  • caused by smoke from fire
  • caused by water or chemical foam used by firefighters or released by fire sprinklers
  • caused by the action of firefighters in action to gain access to a fire, to release heat and smoke, to find the seat of a fire
  • caused by the action to prevent spread of fire
b) Actual cash value is the value of the damaged property under insurance at the time of the loss. Generally, it is the cost of replacing the property, less any depreciation to it. Depreciation is determined by serveral factors, including the physical condition of the property, its resale value and its normal life expectancy, just before the loss. The qualifier is essential because values fluctuate. The cost of replacing damaged or destroyed property may be different after loss than at the ime of the loss.

c) The Automatic Reinstatement rules the insurer to remain the amount of insurance unchanged throughout the policy period, even if losses are paid, it also rules the insurer to return the insured premium calculated on a short-term rate basis for the unexpired part of the policy period if the insured cancels the policy, even after a loss, even amount of recovery has already reached the full amount of insurance.

d) If a policy uses the Replacement Cost endorsement, the special provisions include these conditions,
  1. replacement must be made promptly.
  2. replacement must be on the same site or an adjacent site.
  3. payment will be limited to the cost of replacing, repairing, constructing or reconstructing (whichever is least) on the same site with new property of like kind and quality and for like occupancy.
  4. settlement will be made only when the work is completed and then for no more than the actual cost of the work.
  5. all other insurance covering the same perils (and the same interest) must have the same replacement cost provisions.

Insurance on Property - 2.5

Summarize the explosion coverage under the Basic Fire Policy and explain the effect of adding explosion as an additional peril.

Answer:

Under the Basic Fire Policy, in common law provinces, the explosion coverage covers the damage by the explosion of natural, coal or manufactured gas, in Quebec, it covers the damage by the explosion of fuel with the exclusion of gasoline vapour.

The coverage is boardened when the explosion is added as an additional peril. It covers most kind of explosion damage with the following exclusions,
  1. explosion of or in various types of boilers, pressure vessels and gas turbines;
  2. explosion during pressure testing or resulting from centrifugal force or mechanical breakdown;
  3. explosion by electric arcing, by bursting or rupture due to hydrostatic pressure or freezing or bursting or rupture of safety devices.

Thursday, October 12, 2006

Insurance on Property - 2.4

Under the (IBC) Standard Mortgage Clause:
a) Some provisions benefit the mortgagee. Briefly, describe three such benefits.
b) Which provision might be valuable to the insurer?

Answer:

a) The main benifit of a mortgage clause for the mortgagee is that the policy covers the mortgagee even if the named insured is unable to recover because a condition of the policy has been breached.

The mortgage clause permits the mortgagee to give notice of loss immediately on becoming aware of it, and proof of loss as soon as practicable.

The clause also includes the mortgagee and its assigns among those whom the insurer, acquiring title to the insured property, must continue to insure until the policy is cancelled or expires.

b) Under the mortgage clause, the insurer, having indemnified the mortgagee for a loss, becomes subrogated to the rights of the mortgagee against the insured, but only to the amount of the loss paid to the mortgagee.

Insurance on Property - 2.3

Explain how a stated amount coinsurance clause differs from a 90% coinsurance clause.

Answer:

A stated amount coinsurance clause works on the same purpse as a 90% coinsurance clause. They both encourage insureds to maintain a adequate amount of insurance. However they work differently.
  1. The Stated Amount specifies the minimum amount of insurance in dollars rather than as a percentage of the actual cash value of the property insured.
  2. The Stated Amount simplifies the determination of the adequacy of the amount of insurance, since it is easy to compare the amount of insurace to the Stated Amount coinsurance and the comparason result is valid through out the whole life cycle of the policy. But in the case of a 90% coinsurance clause, the actual cash value must be determined at the time of loss and the adequacy can only be determined at that time.
  3. The Stated Amount needs no Waiver of Coinsurance because no calculation of actual cash value is needed to detemine if the coinsurance clause applies to a loss settlement.
  4. The Stated Amount expires independently of the policy, usually after a certain number of monthes, but the 90% clause is valid throught out the policy life.
  5. The Stated Amount requires an annual Statements of Values so that the amount can be adjusted to reflect the actual value of the property at the time of renewal. The Statements of Values costs both side time and resources and due to this reason, the Stated Amount is more likely to be used when insuring large, high-value complexes under a single item.

Insurance on Property - 2.2

State the amount the insured will be entitle to recover in each of the following cases. Give reasons for each answer and show your calculations.

In all cases, the full value of the property insured is $500,000. The fire policy is subject to an 80% coinsurance clause and a 2% waiver of coinsurance clause.

Amount of Insurance Amount of Loss
A. $300,000 $2,000
B. $450,000 $100,000
C. $350,000 $ 80,000
D. $300,000 $20,000

Answer:

The recovery for any loss under a policy with coinsurance before considering the waiver is calculated by this formula,

Amount of Recovery = Amount of Loss * Amount Carried / Amount Required

where the Amount Carried is the specified amount of insurance and Amount Required is the coinsurance of the total value of the property insured. In this case, the Amount Required is $400,000, which is the 80%, the coinsurance, of $500,000, the full value of the property.

The waiver of the coinsurance clause in the policy is 2%, which nullifies the coinsurance clause for losses less than 2% of the amount of insurance. Only when the loss exceeds 2%, the coinsurance clause will apply.

A. The waiver is 2%*$300,000 and results $6,000. The amount of loss is $2,000 and it doesn't exceed the waiver. Thus the coinsurance clause will not apply and the amount of recovery will be the full amount of loss, which is $2,000.

B. The waiver is 2%*$450,000 and results $9,000. The amount of loss is $100,000 and it exceed the waiver. The coinsurance clause will click. However, since the amount of insurance also exceeds the $400,000 minimum required by the coinsurance clause, the amount of recovery will the full amount of loss, $100,000.

C. The waiver is 2%*$350,000 and gets $7,000. The amount of loss is $80,000 and exceeds the waiver. The coinsurance clause will work. At the same time, the amount of insurance is less than $400,000 which is minimum required. We use the formula

$350,000/$400,000 * $80,000 = $70,000

Therefore, the amount of recovery is $70,000.

D. The waiver is 2%*$300,000, $6,000. The amount of loss $20,000 is greater than the waiver. The coinsurance clause will apply. The amount of insurance is less than the minimum required. We use the formula

$300,000/$400,000 * $20,000 = $12,000

The $12,000 is the amount of recovery which the insured entitles.

Insurance on Property - 2.1

A fire policy is to be issued for the following property, located in Alberta:
- a building occupied as an office
- contents of the office
- merchandise stored in a warehouse several blocks from the office.

Separate amounts of insurance are to apply to each item and the policy is to contain a deductible provision.
a) What should the insured consider in deciding whether to select a deductible on a per item or per occurrence basis?
b) What steps must the insurer take to be sure the deductible is enforceable?

Answer:

a) Deductible on a per item basis means the deductible applies separately to the amount recoverable under each item. Deductible on a per occurrence basis means the deductible is substracted from the total amount of loss or damage arising from a single event. For the insured to get the same coverage with lower premium or to get a better coverage with same premium, it should consider that its first and second item are at the same location, but the third item is at another location. The probability that a single event happens on both locations is low, so that the per item basis normally works better for its situation.

b) The insurer will need to comply with the Statutory Conditions and stamp or print "This policy contains a clause that may limit the amount payable," on the face of the policy, in red ink and/or in a specified size and/or in bold font.

Wednesday, October 11, 2006

Thread Priority and Scheduling

If there is more than one thread in a Ready state at a given time, the thread scheduler must decide which thread should run first, and it does so based on the fixed priority scheduling algorithm.

In fixed priority scheduling, the scheduler chooses the highest-priority thread to run first. Lower-priority threads will run only when the highest-priority thread dies, yields, or enters one of the Not Runnable states. If an even higher-priority thread becomes Ready, it should usually pre-empt the original thread and gain control of the CPU.

If all Ready threads have the same priority, the thread scheduler chooses a thread at random. It won't necessarily be the one that has waited longest. If a high priority thread has a run method with no pauses in the code – sleep or wait method calls, for example – it will keep control of the CPU until its run method finishes. This is known as a selfish thread.

In pre-emptive implementation, such threads will either give the CPU up by themselves or be pre-empted by a thread of higher priority.

In time-slicing implementation, a thread runs for a specific time and then enters the runnable state, at which point the scheduler decides wether to return to the thread or schedule a different thread. This means that if more than one thread has equal, highest priority, the threads take turns at the CPU for finite slots of time until one finishes or a higher-priority thread becomes ready. (Win 95/NT)

Not all platforms implement scheduling in the same way, you need to be careful when writing programs that depend on manipulating thread priorities, because they may not run in the same way on all Java Virtual Machines (VMs).

Runnable vs Thread

It is usually better programming practice to use the Runnable interface rather than overriding the Thread class's run method.

Java does not support multiple inheritance, so classes that are subclasses of Thread cannot be subclasses of any other class. If you use the Runnable interface, however, you can create threads using classes that already have subclasses.

This approach is helpful when constructing your class hierarchy. Rather than saying that an object of your class "is a" thread, your class is associated with a thread that executes its code.

A further advantage of using the Runnable interface's run method is that this can make it easier for the run method to access protected methods and variables of its superclasses.

That is, because the run method belongs to a subclass, it gains access to methods and variables denied to non-subclassed classes.

Tuesday, October 10, 2006

Isolation Level

To understand isolation level, you need to understand three problems related to concurrency control, dirty reads, unrepeatable reads and phantoms.

Dirty Reads

A dirty read occurs when your application reads data from a database that has not been committed to permanent storage yet. Consider two instances of the same component performing the following:
  1. You read account balance X from the database. The database now contains X = 0.
  2. You add 10 to X and save it to the database. Now X = 10, but not committed, this is so-called dirty.
  3. Another instance reads X from database, it will get X = 10, which is dirty.
  4. You abort the transaction, which restores the X to 0.
  5. The other instance adds 10 to X and saves. The database now contains X = 20.
The problem here is the second instance commit its transaction based on a dirty data. The problem of reading uncommitted data is a dirty read.

Unrepeatable Read

Unrepeatable read occur when a component reads data from database, but upon re-reading the same data, the data has been changed. This can arise when another concurrently executing transaction modifies the data. For example,
  1. You read a data set X from database.
  2. Another component overwrites all or part of the set X.
  3. You re-read the set X and values have changed.
To prevent such changes, you need to lock out other components from modifying the data.

Phantom

Phantom is a new set of data that inserted in a database between two read operations. For example:
  1. You read the database and find 5 computers ordered by A.
  2. A order another computer.
  3. You re-read the database and find 6 computers by A.
  4. If one of your transaction depends on the number of computers ordered, you will have problem to believe when the number will not change during your transaction.
Now it becomes very easy to understand these isolation levels. READ UNCOMMITTED prevents none of these problems. READ COMMITTED prevents only the dirty read. REPEATABLE READ prevents dirty read and unrepeatable read. SERIALIZABLE prevents all the above mentioned problems.

Thursday, October 05, 2006

Insurance on Property - 1.9

In general terms, describe how the policy conditions address TWO(2) of the following. Indicate whether you are discussing the Statutory Conditions or the General Conditions.
a) Material change in risk.
b) Limitation of action.
c) Requirements after a loss.
d) Disagreements over amount of loss.

Answer:

In the Statutory Conditions,

b) the Action addresses the limitation of action. An insured who intends to pursue a grievance against an insurer in court must begin within a specified time. This period varies somewhat across Canada. In most common law provinces, the limit is one year after loss or damage occurs. In Manitoba and in in Yukon Territory, it is two years.

d) the Appraisal addresses the disagreements over amount of loss. Disagreements over amount of loss shall be determined by appraisal as provided under the Insurance Act before there can be any recovery under this contract. There shall be no right to an appraisal until a specific demand therefor is made in writting and until after proof of loss has been delivered.

Insurance on Property - 1.8

While investigating a claim under a fire insurance policy, the insurer discovers that the insured misrepresented a material circumstance of the risk when applying for the policy. As a result, the premium is only 50% of what is should have been.

Assume that the insurer is located in a common law province and that only the matter of the misrepresentation remains to determine the insurer's response to the claim.

Must the insurer pay the claim? Discuss the insurer's options. What policy conditions determine these options?

How does your answer change if the insurer is located in Quebec?

Answer:

The insurer may avoid the policy so that the insurer will not pay the claim. Since the insured misrepresented a material circumstance of the risk, and an inadequate permium of 50% has been charged for the risk.

However, the policy can be voided only if the insurer can prove the misrepresentation was metarial to the acceptance of or the 50% permium charged for the risk. If the insurer does not prove it, the insurer will still need to pay the claim and actually in 100% of the amount, but at the same time, correct the representation of the risk and amend the premium to 2 times of the current value.

The policy condition which determines these options is the Misrepresentation, Statutory Condition 1.

If the insurer is located in Quebec, these options will be determined by Misrepresentations or Concealment in Statements of the General Conditions.

Under this General Condition, the insurer may nullify the policy even if the loss is not connected to the misrepresentation, so that it will not pay the claim. Similar to other common law provinces, the insurer need to prove the bad faith on the insured. Or it need to establish the fact that it would not accept the risk if it had discovered the misrepresentation.

If the insurer cannot prove the bad faith nor the non-acceptance of risk, it must pay the portion of the loss that the premium collected bears to the premium it should have collected, in this case, it must pay 50% of the claim.

Unlike the Statutory Conditions, the General Condition does not govern how the insurer should alter the policy or charge the insured on additional premium.

Wednesday, October 04, 2006

Insurance on Property - 1.7

Summarize the requirements of the fire insurance policy conditions regarding length and manner of notice and premium computation if the policy is terminated prior to the expiry date in the policy declarations. (Relate your answer to either the common law provinces or Quebec. State which one.)

Answer:

According to Civil Code of Quebec, fire insurance policy can be concelled at any time before it expires.

By mere written notice from each of the Named Insureds, the termination takes effect upon receipt of the notice. By the insurer giving written notice to each Named Insured, the termination takes effect fifteen days following receipt of such notice by the Insured at his last known address.

If the insurer cancels, it shall refund the insureds the excess of premium actually paid over the pro rata premium for the expired time. The pro rata premium is the same proportion of the total that the effective period of the policy before cancellation was of the original policy term.

If the insureds request cancellation, the insurer should refund the insureds the excess of the premium actually paid over the short-term rate for the expired time. This allows the insurer retains its pro rata premium and a surcharge.

Insurance on Property - 1.6

A company operates two retail stores: one in Winnipeg, the other in Quebec City. The owner asks the broker to obtain a single fire insurance policy to insure merchandise at each store. (Separate amounts of insurance are given.)
a) What main article in the Civil Code of Quebec will the broker consider in selecting the insurer to issue the policy? Why?
b) What legal requirements must the insurer bear in mind in issuing such a policy?

Answer:
a) The broker need to consider the Article 3119 of the Civil Code of Quebec. This article allows properties located in Quebec and in other provinces can be insured under one policy, as long as the insured property locates in Quebec, or the interest of the insured or other interested party situates in Quebec, or the insured applies the insurance in Quebec or the insurer issues the policy in Quebec.
b) When the insurer issues such a policy which covers property in Quebec City and in Winnipeg, the insurer must include both Statutory and General Conditions in the policy. The Statutory Conditions may include a statement that they do not apply to the merchandise at the retail store in Quebec City. And the General Conditions may include a statement that they apply only to the merchandise at the retail store in Quebec City.