Section 3-407 allows a contract to “be construed before or after a breach of the contract.” Granting a motion to dismiss a declaratory judgment action without declaring the rights of the parties rarely is appropriate. Post v. Bregman, 349 Md. 142, 160, 707 A.2d 806, 814 (1998); Broadwater v. State, 303 Md. 461, 465, 494 A.2d 934, 936 (1985); State v. Burning Tree Club, Inc., 301 Md. 9, 17-18, 481 A.2d 785, 789 (1984); Borders v. Board of Educ., 259 Md. 256, 258-59, 269 A.2d 570, 571 (1970); Woodland Beach Property Owners’ Ass’n v. Worley, 253 Md. 442, 447-48, 252 A.2d 827, 830 (1969); Hunt v. Montgomery County, 248 Md. 403, 408-10, 237 A.2d 35, 37-39 (1968). “Ordinarily the only place a [dismissal] has in the declaratory process is to challenge the legal availability of the remedy sought to be used.” Hunt, 248 Md. at 408, 237 A.2d at 37. This Court has said that
[t]he test of the sufficiency of the [complaint for declaratory judgment] is not whether it shows that the plaintiff is entitled to the declaration of rights or interest in accordance with his theory, but whether he is entitled to a declaration at all; so, even though the plaintiff may be on the losing side of the dispute, if he states the existence of a controversy which should be settled, he states a cause of suit for a declaratory decree.
Shapiro v. Board of County Comm’rs, 219 Md. 298, 302-03, 149 A.2d 396, 399 (1959).
As an example of when a claim for declaratory judgment would not be available, we have said that
as a general rule, courts will not entertain a declaratory judgment action “if there is pending, at the time of the commencement of the action for declaratory relief, another action or proceeding involving the same parties and in which the identical issues that are involved in the declaratory action may be adjudicated.”
Post, 349 Md. at 160, 707 A.2d at 814 (quoting
Waicker v. Colbert, 347 Md. 108, 113, 699 A.2d 426, 428 (1997));
see also Turnpike Farm Ltd. Partnership v. Curran, 316 Md. 47, 49, 557 A.2d 225, 226 (1989);
Northern Assurance Co. v. EDP Floors, Inc., 311 Md. 217, 223, 533 A.2d 682, 685 (1987). That