
290 Md. 345 (1981)
PAUL G. BENDER ET AL.
v.
SECRETARY, MARYLAND DEPARTMENT OF PERSONNEL ET AL.
[No. 22, September Term, 1980.]
Court of Appeals of Maryland.
Decided May 28, 1981.
*346 The cause was argued before MURPHY, C.J., and SMITH, DIGGES, ELDRIDGE, COLE and DAVIDSON, JJ.
James E. Carbine, with whom were J. Edward Davis and Weinberg & Green on the brief, for appellants.
Robert B. Harrison, III and Scott A. Livingston, Assistant Attorneys General, with whom were Stephen H. Sachs, Attorney General, and James F. Truitt, Jr., Assistant Attorney General, on the brief, for appellees.
DAVIDSON, J., delivered the opinion of the Court.
This case presents a question involving necessary parties to a declaratory judgment action. The petitioners, Paul G. Bender, a classified employee of the Maryland Department of Transportation, and Robert Stephens, a classified employee of the Maryland Department of Health and Mental Hygiene (classified employees), filed a Petition for Declaratory and Injunctive Relief in the Circuit Court of Baltimore City. The petition alleged that the respondents, the Secretary of Transportation and the Secretary of Personnel (Secretaries), had abolished a number of classified positions of employment and had illegally established approximately 350 unclassified positions within the Department of Transportation.[1] The petition requested:
1) a declaration that the 350 unclassified positions were illegally established;
2) a mandatory injunction compelling the Secretaries to abolish the illegally established positions;

*347 3) an injunction, in the event that the Secretaries failed to comply, prohibiting payment of salaries to employees holding illegally established positions;
4) an injunction prohibiting the Secretaries from establishing any unclassified positions in the future without approval from the Court; and
5) such other and further relief as the cause may require.
The Secretaries filed a Motion Raising Preliminary Objection on the ground, insofar as here relevant, of "want of necessary parties." In a Memorandum and Order on Preliminary Matters entered 17 November 1977, the trial court determined that the unclassified employees had an interest that would be affected by a declaration that their positions had been illegally established and that they were, therefore, necessary parties. It recognized that an amendment adding the approximately 350 interested unclassified employees as parties would be an appropriate remedy. However, in an effort to prevent that "time-consuming and expensive undertaking," it decided to fashion an alternative remedy. The trial court indicated that because any of the unclassified employees "would have the right under Maryland Rule 208 to intervene as a defendant to protect his employment interests," it "would permit any employee who file[d] a motion to intervene under Md. Rule 208 to do so."[2] It *348 directed the parties to formulate a procedure for notifying all of the unclassified employees of "their right to intervene as additional defendants." Proposed procedures were to be submitted to the trial court for approval.
Subsequently, the parties agreed to a procedure by which each of the unclassified employees would be notified that they had a right to
"file a Motion to Intervene as a party Defendant to this action, in accordance with the provisions of Rule 208(a) and (c) of the Maryland Rules of Procedure...."
On 19 December 1977, the trial court entered an order implementing the agreed-upon procedure. That order expressly stated:
"[A]ny Motion to Intervene filed pursuant to the terms of this Order be, and is hereby, deemed to be an application for intervention as of right pursuant to Maryland Rule 208(a)...."
On 16 May 1978, before this procedure was fully implemented, the General Assembly enacted Chapter 440 of the 1978 Laws of Maryland, effective 1 July 1978, codified, in part, as Md. Code (1957, 1979 Repl. Vol.), Art. 64A, § 51A. That section permitted any of the unclassified employees, whose jobs might be held to have been illegally established, to transfer into the State Merit System.
On 13 July 1978, the trial court, after a hearing, determined that as a result of the enactment of this section, the unclassified employees did not need to be made parties to the suit and, therefore, did not need to be notified. On 19 April 1979, after a trial on the merits, the trial court declared that 323 of the 350 unclassified positions had been illegally established, designated those positions as classified positions within the Department of Transportation, and entered a judgment.
The Secretaries appealed to the Court of Special Appeals. That Court found that despite the existence of Art. 64A, *349 § 51A the unclassified employees had interests that would be affected and were, therefore, necessary parties. The Court of Special Appeals reversed and remanded the case directing that the trial court "compel compliance with [its] November 17, 1977 Memorandum and Order on Preliminary Matters." Secretary, Dept. of Personnel v. Bender, 44 Md. App. 714, 727-32, 411 A.2d 107, 114-16 (1980).
The classified employees filed a petition for a writ of certiorari that we granted. We agree with the Court of Special Appeals that the unclassified employees are necessary parties, and, to that extent, we shall affirm its judgment reversing the trial court on the merits. However, we do not agree with the Court of Special Appeals that upon remand of the case the trial court should be directed to comply with its 17 November 1977 Memorandum and Order.[3] Accordingly, we shall remand the case to the Court of Special Appeals with instructions that the trial court be directed to permit either an amendment adding the unclassified employees as parties or, if appropriate, a class action under Md. Rule 209.
Maryland Code (1974, 1980 Repl. Vol.) § 3-405 (a) (1) and (2) of the Courts and Judicial Proceedings Article provides:
"(a) Person who has or claims interest as party.  (1) If declaratory relief is sought, a person who has or claims any interest which would be affected by the declaration, shall be made a party.

*350 (2) Except in a class action, the declaration may not prejudice the rights of any person not a party to the proceeding." (Emphasis added.)
Ordinarily, in an action for declaratory judgment, all persons who have an interest in the declaration are necessary parties. Williams v. Moore, 215 Md. 181, 185, 137 A.2d 193, 196 (1957); United Slate Tile & Composition Workers Ass'n Local No. 80 v. United Brotherhood of Carpenters & Joiners of America, Local No. 101, 185 Md. 32, 37, 42 A.2d 913, 915 (1945). See Saunders v. Roland Park Co., 174 Md. 188, 193, 198 A. 269, 270 (1938). Any person who, as a result of a declaration, may gain or be deprived of a legal right or other benefit has an interest that might be affected by the outcome of the action and is, therefore, a necessary party. Reddick v. State, 213 Md. 18, 29, 130 A.2d 762, 767, cert. denied, 355 U.S. 832, 78 S.Ct. 50 (1957); Crook v. Brown, 11 Md. 158, 164 (1857). More specifically, any person who may be deprived of his employment as a result of a declaration that such employment is illegally established has an interest that might be affected by the outcome of the action and is, therefore, a necessary party. Gannon v. Park, 46 Ohio St.2d 301, 311, 348 N.E.2d 342, 348-49 (1976); Paterra v. Charleroi Area School Dist., 22 Pa. Commw. Ct. 451, 454, 349 A.2d 813, 815 (1975). See County Dept. of Public Welfare of Lake County v. Morrow, 158 Ind. App. 106, 109, 301 N.E.2d 787, 788-90 (1973).
Necessary parties must be made parties to the proceeding. Md. Code § 3-405 (a) (1) of the Courts and Judicial Proceedings Article. Their presence cannot be waived by the other parties to the proceedings. Williams, 215 Md. at 185, 137 A.2d at 196. While this Court has on occasion dismissed after a failure to join necessary parties, Atkinson v. Sapperstein, 191 Md. 301, 316, 60 A.2d 737, 743 (1948); Saunders, 174 Md. at 194, 198 A. at 271, it has indicated that ordinarily dismissal is undesirable and that a preferable procedure is to permit an amendment joining the necessary parties. Kelley v. Davis, 233 Md. 494, 498, 197 A.2d 230, 231-32 (1964). See Givner v. Cohen, 208 Md. 23, 35, 116 A.2d 357, 362 (1955).
*351 One purpose of this rule is to assure that a person's rights are not adjudicated unless that person has had his "day in court." This rule also prevents multiplicity of litigation by assuring a determination of the entire controversy in a single proceeding. Reddick, 213 Md. at 30, 130 A.2d at 767-68; McMahon v. Consistory of St. Paul's Reformed Church, 194 Md. 262, 268, 71 A.2d 17, 20 (1950); Crook, 11 Md. at 164.
Here the classified employees are requesting that the jobs of 350 unclassified employees be declared to be illegally established and that the Secretaries be enjoined from paying salaries to persons holding unclassified positions that are declared to be illegally established. The classified employees contend that as a result of the enactment of Art. 64A, § 51A, the jobs and salaries of the unclassified employees are adequately protected and that these employees have "no other `interest' in this litigation requiring their joinder." The classified employees maintain that any "other interest" of the unclassified employees must be derived from the Constitution of the United States or the Laws of the State of Maryland. The classified employees point out that unclassified positions are ordinarily terminable at will and assert that, consequently, neither the Constitution, see, e.g., Bishop v. Wood, 426 U.S. 341, 346-47, 96 S.Ct. 2074, 2078-79 (1976); Board of Regents of State Colleges v. Roth, 408 U.S. 564, 578, 92 S.Ct. 2701, 2710 (1972), nor state law, see Small v. Secretary of Personnel, 267 Md. 532, 535-36, 298 A.2d 173, 174-75 (1973); Ahlgren v. Cromwell, 179 Md. 243, 245-46, 17 A.2d 134, 135-36 (1941), affords unclassified employees a property right or litigable interest in the terms and conditions of their employment. The classified employees conclude that the unclassified employees are not necessary parties. We do not agree.
Maryland Code (1957, 1979 Repl. Vol.), Art. 64A, § 3 and Md. Code (1977) § 2-102 (d) and § 6-204 (n) of the Transportation Article authorize the establishment of certain enumerated unclassified positions. While unclassified positions are terminable at will, these sections afford unclassified employees the right to continue to occupy such *352 positions and to enjoy the rights and benefits of those positions including all of the terms and conditions of their employment such as their duties and job location, their salary, and their fringe benefits until they are terminated by an exercise of discretion by the Secretary. A declaration that certain unclassified positions were illegally established would result in such employees losing their unclassified positions in the absence of an exercise of discretion by the Secretary. Thus, before the enactment of Art. 64A, § 51A, such unclassified employees would have been necessary parties because they might have been deprived of a legal right or a benefit and, thus, affected by the relief sought.
While Art. 64A, § 51A protects the unclassified employees' interests by assuring them positions, that section does not adequately protect the "other interest[s]" of such employees in certain terms and conditions of employment. Because these interests may be affected by the outcome of the action, the unclassified employees remain necessary parties despite the enactment of Art. 64A, § 51A.
Article 64A, § 51A provides:
"(a) An employee who is transferred to the State merit system according to this section, unless otherwise specified in the enabling legislation transferring such employee to the State merit system, shall be appointed without further examination or qualification. The employee shall be placed in the State classification that is comparable in duties and responsibilities to the employee's former position.

(b) The employee may not suffer a diminution of salary or wages, accrued leave, whether earned or granted, or seniority rights. Any increase in salary or wages granted subsequent to passage of the legislation enabling the transfer, may be retained on appointment to the classified service only if the Secretary approves. The Secretary shall consider the monetary value of any and all other benefits, entitlements, services or prerogatives and, at his *353 discretion and in consideration of the best interests of the classified service, may consider these values or a portion of them when establishing the rate of salary on appointment. After appointment, the employee is entitled to the same benefits provided to classified employees established by this article." (Emphasis added.)
"SECTION 2 ... [T]he Secretary of Personnel shall transfer to the State merit system any key or unclassified employee of the Department of Transportation whose position is judicially determined in any action filed in any court of competent jurisdiction prior to January 1, 1978 to have been created unlawfully or otherwise be unlawful."[4] (Emphasis in original deleted.)
Article 64A, § 51A protects the right of any unclassified employee, whose job is declared to be illegally established, to be transferred without further examination or qualification to a position that is "comparable in duties and responsibilities to the employee's former position." While this section guarantees that such an unclassified employee will be transferred to "a comparable" position, it does not assure that such an employee will be transferred to an identical position.[5] Article 64A, § 51A does not assure that such an employee would be transferred to a position requiring performance of the same duties in the same location.[6] Under these circumstances, the terms and *354 conditions of employment of the 350 unclassified employees whose jobs might be declared to be illegally established might be affected despite the existence of Art. 64A, § 51A.
In addition, Art. 64A, § 51A protects the right of any unclassified employee, whose job is declared to be illegally established against "a diminution of salary or wages." Nevertheless, that section also provides that "[a]ny increase in salary or wages granted subsequent to passage of the legislation enabling the transfer, may be retained on appointment to the classified service only if the Secretary *355 approves." (Emphasis added.) This provision establishes that any of the unclassified employees who received an increase in salary after 16 May 1978 would not be entitled to transfer as of right into the Merit System at the increased salary. Such employees would receive their increased salary only if the Secretary approves. Thus, despite the existence of Art. 64A, § 51A, such employees, as a practical matter, may be affected by a substantial diminution of salary.
Finally, Art. 64A, § 51A protects the right of any unclassified employee whose job is declared to be illegally established against a "diminution of ... accrued leave, whether earned or granted, or seniority rights." Nevertheless, that section also provides that "[t]he Secretary shall consider the monetary value of any and all other benefits, entitlements, services or prerogatives and, at his discretion and in consideration of the best interests of the classified service, may consider these values or a portion of them when establishing the rate of salary on appointment." (Emphasis added.) This provision establishes that any of the unclassified employees receiving fringe benefits other than leave or seniority rights would not be entitled to transfer into the Merit System with the fringe benefits they were receiving as unclassified employees. Rather, such employees would be compensated for lost fringe benefits only if the Secretary approves. Thus, despite the existence of Art. 64A, § 51A, such employees, as a practical matter, may be affected by a substantial diminution of fringe benefits without a compensatory salary increase.
In sum, despite the existence of Art. 64A, § 51A, the 350 unclassified employees might be affected by a change in the terms and conditions of their employment, including a change in duties and job location, a diminution in salary, and a diminution of fringe benefits without compensation as a result of a declaration that their unclassified positions were illegally established.[7] Because these employees may be *356 deprived of substantial legal rights or benefits under such circumstances, they have an interest in the subject matter of this suit that might be affected by a declaration. Therefore, the 350 unclassified employees are necessary parties to this proceeding who must be joined in order to assure that each such employee has his "day in court" and to prevent a multiplicity of litigation.[8] Accordingly, we shall affirm the judgment of the Court of Special Appeals and remand the case to that Court with instructions to remand the case to the trial court with directions to permit either an amendment adding the 350 unclassified employees as parties or, if appropriate, a class action under Md. Rule 209.
Judgment of the Court of Special Appeals affirmed.
Case remanded to that court with instructions to reverse the judgment of the Circuit Court of Baltimore City and to remand the case to that court for further proceedings in accordance with this opinion.
Costs to be paid by petitioners.
NOTES
[1]  "Classified" positions are positions within the Merit System that are regulated under Md. Code (1957, 1979 Repl. Vol., & 1980 Cum. Supp.), Art. 64A. "Unclassified" positions are positions outside of the Merit System that are exempt from regulation under Art. 64A and are ordinarily terminable at the pleasure of the Secretary of the department within which the positions are established. Art. 64A, § 3 and Md. Code (1977) § 2-102 (d) and § 6-204 (n) of the Transportation Article. See Ahlgren v. Cromwell, 179 Md. 243, 245-46, 17 A.2d 134, 135-36 (1941).
[2]  Md. Rule 208, Intervention, provides in pertinent part:

"a. Of Right.
Upon timely application a person shall be permitted to intervene in an action: (a) when the representation of the applicant's interest by existing parties is or may be inadequate and the applicant is or may be bound by a judgment in the action....
...
c. Procedure.
1. Motion.
An application to intervene shall be made by motion." (Emphasis added.)
[3]  In our view, the remedy fashioned in the trial court's 17 November 1977 Memorandum and Order was technically deficient. A person who files a motion to intervene as of right, in accordance with the provisions of Md. Rule 208 a, does not have the right to become a party unless he can show, among other things, that the representation of his interests by other existing parties is or may be inadequate. Maryland Radiological Soc'y, Inc. v. Health Servs. Cost Review Comm'n, 285 Md. 383, 390-92, 402 A.2d 907, 911-12 (1979).

Here, if the procedure established by the trial court were to be followed, it is possible that some unclassified employees who file motions to intervene as of right might be denied that right on the ground that their interests would be adequately represented by other parties. Thus, such employees would not become parties to the proceeding despite our determination that they are necessary parties.
[4]  Art. 64A, § 51A, as codified, does not include Section 2 which appears only in Chapter 440 of the 1978 Laws of Maryland.
[5]  In deciding the merits of this case, the trial court decided that "each of the ... [illegally established unclassified] positions is deemed to be established as a `classified position'" within the Department of Transportation. Although the question whether the trial court had authority to establish the unclassified positions as classified positions was not raised or determined in the trial court and was not raised in the Court of Special Appeals, that Court indicated that the trial court, in taking this action, might have exceeded its authority.

Here, the classified employees' contention that the trial court did not exceed its authority will not be considered because it is inappropriate to decide a question on the merits in the absence of necessary parties.
[6]  Here the record shows that certain of the unclassified positions established had job classifications that did not previously exist in the classified or unclassified service. For example, the job classification of Operations Specialist I did not exist in the classified or unclassified service before it was established as a job classification for an unclassified position in the Department of Transportation. Therefore, despite the existence of Art. 64A, § 51A, such unclassified employees might not be placed in identical positions in the classified service if their unclassified positions are declared to be illegally established because such classified positions might not exist.

In addition, the record shows that certain of the unclassified positions had job classifications that previously existed in the classified service, but these unclassified positions were established when other positions with substantially different job classifications and job descriptions were abolished from the classified service. For example, the position of Secretary, a job classification that previously existed in the classified service, was established as an unclassified position in the Department of Transportation when the position of Traffic Control Electrician I was abolished from the classified service.
Manifestly, because Secretary and Traffic Control Electrician I are different job classifications that have job descriptions that are substantially different, these positions are not "comparable in duties and responsibilities." Therefore, unclassified employees holding such positions might not be placed in identical positions in the classified service if their unclassified positions are declared to be illegally established because such classified positions might not exist within the Department of Transportation.
Finally, certain of the unclassified positions had job classifications that previously existed in the classified service and were established when other positions with identical job classifications and job descriptions were abolished from the classified service. For example, the position of Chief, Right-of-Way Division, State Highway Administration, was established as an unclassified position in the Department of Transportation when the previously existing unclassified position of Chief, Right-of-Way Division, Division of the State Roads Commission, was abolished. Such unclassified employees might be placed in identical positions in the classified service if their unclassified positions are declared to be illegally established. However, Art. 64A, § 51A does not protect even these employees from being transferred to an identical position in a different department or in a different geographical location in the Department of Transportation.
Under all of these circumstances, despite the existence of Art. 64A, § 51A, the terms and conditions of employment of the unclassified employees whose jobs might be declared to be illegally established might be affected.
[7]  In view of our decision that Art. 64A, § 51A does not adequately protect the terms and conditions of employment with respect to duties and job location, salary, and fringe benefits of the unclassified employees, we need not consider the classified employees' contentions that the unclassified employees have no interest in retaining their "unclassified status" or that Art. 64A, § 43 does not subject the unclassified employees to personal liability.
[8]  Although the question whether Art. 64A, § 51A is constitutional was not raised or determined in the trial court and was not raised in the Court of Special Appeals, that Court indicated that Art. 64A, § 51A might be unconstitutional. Here the parties contend that this Court should decide whether Art. 64A, § 51A is constitutional. In view of our decision that the unclassified employees are necessary parties because Art. 64A, § 51A does not adequately protect the interests of such employees, it is unnecessary, and indeed would be premature, to decide whether Art. 64A, § 51A is constitutional.

Moreover, in view of our decision that the unclassified employees are necessary parties, we need not consider any of the classified employees' contentions concerning the merits of the case.
