
197 A.2d 287 (1964)
In re CITY OF WARWICK.
Equity No. 3029.
Supreme Court of Rhode Island.
February 11, 1964.
James R. Morriss, City Solicitor, Howard R. Haronian, Asst. City Solicitor, for City of Warwick.
Donald P. Ryan, Ralph T. Lewis, Jr., Carmine R. DiPetrillo, Providence, for respondents.
JOSLIN, Justice.
This is a petition for a declaratory judgment under the uniform declaratory judgments act, G.L. 1956, chap. 30 of title 9. It was brought by Horace Hobbs in his capacity as mayor of the city of Warwick and seeks a declaration as to whether the mode and manner of selection of members of the board of canvassers, the zoning board of review, and the board of assessment review are to be determined by the provisions of the municipal charter enacted by the legislature *288 in 1960 or by statutes of general application enacted prior to 1960. The case is before us on an appeal from a decree of the superior court finding that the charter provisions control.
At all times relevant hereto members of the subject boards held office by virtue of appointments under the general statutes rather than the charter. The board of canvassers has three members, the board of assessment review three, and the zoning board of review five with provision for selection of an auxiliary member.
The petition herein names no respondents, contains no prayer for process, and no process of any kind was issued. At the hearing before the superior court one member of each of the three boards appeared notwithstanding that he had not been made a party thereto nor had process been served upon him. Those members, hereinafter referred to as respondents, at that hearing contended that the general statutes controlled appointments to the several boards and it was the position of the mayor that the charter provisions governed. The other members of the several boards, hereinafter referred to as board members, in no way participated in the proceedings either before the superior court or before this court.
The respondents contend that the failure to join all of the board members as parties is fatal to these proceedings. That such contention is raised initially before us is unobjectionable since jurisdiction over the subject matter can be raised at any stage of the proceedings. McGann v. Board of Elections, 85 R.I. 223, 235; State Loan Co. v. Barry, 71 R.I. 188, 189; Hazard v. Coyle, 22 R.I. 435.
The relevant statute is G.L. 1956, § 9-30-11, which provides that "When declaratory relief is sought, all persons shall be made parties who have or claim any interest which would be affected by the declaration, and no declaration shall prejudice the rights of persons not parties to the proceeding."
It has generally been held that this provision is mandatory and that failure to join parties who have an interest which would be affected by the declaration is ordinarily fatal. Williams v. Moore, 215 Md. 181; Redick v. Peony Park, 151 Neb. 442; Kilroy v. O'Connor, 324 Mass. 238; Brennan v. Russell, 133 Conn. 442; Franklin Life Ins. Co. v. Johnson, (10th cir.) 157 F.2d 653.
Essentially what is here at issue is whether the term of office to which each of the board members has been appointed can be terminated by virtue of the selection of a replacement under the provisions of the 1960 charter. In the determination of that issue it is obvious that each of the board members has an actual and essential interest. Failure to join all of them as parties pursuant to the mandate of § 9-30-11 deprives the decree appealed from of any binding effect as to the board members not joined and could in the future lead to needless litigation if the rights declared herein were attempted to be enforced against them. Manhattan Storage & Warehouse Co. v. Movers & Warehousemen's Ass'n Etc., 289 N.Y. 82, 88; Borchard, Declaratory Judgments (2d ed.), p. 256.
Such a result defeats one of the essential purposes of the declaratory judgments act which as stated in G.L. 1956, § 9-30-6, is to "terminate the uncertainty or controversy giving rise to the proceeding." See Quackenbush v. City of Cheyenne, 52 Wyo. 146; Southern Nebraska Power Co. v. Village of Deshler, 130 Neb. 133.
The petitioner contends, however, that the requirement as to joinder of necessary parties is satisfied by the appearances of the respondents in these proceedings, they being members of the same classes as the other board members. Assuming without *289 deciding that such appearances made them parties under Industrial Trust Co. v. Rabinowitz, 65 R.I. 20, and C.C. Greene & Brother v. Austin, 10 R.I. 311, we nonetheless find that contention to be without application to this case in the posture in which it is before us. The petitioner cites no authority for the doctrine of representation advanced by him and the authorities we have found excuse nonjoinder and allow representation by class members only in circumstances where it is impractical to require the joinder of all members of the class. That impracticability may exist when the members of the class whose rights are to be affected are so numerous or service upon them would entail such difficulties as would impose an unreasonable burden on the moving party. See National Transportation Co. v. Toquet, 123 Conn. 468; Borchard, supra, p. 270.
The exception as thus developed elsewhere represents a compromise which a court may in its judicial discretion adopt as between the desire for conclusiveness as to all interested parties and convenience in joining them. Assuming without deciding that under appropriate circumstances we would adopt the Connecticut rule, this would not be a case warranting the exercise of that discretion since the classes to be affected consist only of a limited number of persons and there is nothing in the record indicating the unavailability of any of their members for service of process.
The petitioner further contends that joinder of the board members is not here required since the city solicitor who appeared in his behalf under art. 8-4 of the charter is the legal advisor of all municipal officers, departments and agencies. Stated otherwise, petitioner argues that the city solicitor appeared not only on his behalf but also as the attorney for board members whose ouster he sought. That contention is obviously without merit, it being fundamental that an attorney cannot in such circumstances represent parties having adverse interests. See Nelson v. Streeter, 65 R.I. 13, 19.
In our opinion the joinder of each member of each of the boards was a condition precedent to the exercise of jurisdiction in this cause. All those necessary not having been made parties, the action of the superior court must fall. Because of our conclusion we reach neither the question of whether the fact situation presents a justiciable controversy nor the merits of the case.
The respondents' appeal is sustained, the decree appealed from is reversed, and the cause is remanded to the superior court for further proceedings.
PAOLINO and POWERS, JJ., not participating.
