The plaintiffs appeal from a judgment dismissing under Mass.R.Civ.P. 12(b), 365 Mass. 755 (1974), their complaint for injunctive relief and for a declaration that a portion of Section 27-2 of the Revised Ordinances of the City of Springfield, effective September 12, 1972, establishing the Quadrangle-Mattoon Street Historic District is invalid and unconstitutional. The claim for injunctive relief has been disposed of in prior proceedings, and only the claim for declaratory relief remains. The complaint was properly dismissed.
Chapter 231A, Section 8, of the General Laws, as amended by St. 1974, c. 630, Section 4, requires that in any proceeding "which involves the validity of a municipal ordinance . . . the municipality shall be made a party." The city of Springfield is, therefore, a necessary party, and a declaratory judgment cannot be entered in its absence. Morgan v. Banas, 331 Mass. 694 , 698 (1954). Although the building commissioner of Springfield was made a party he is not the city, cf. Mayor of Cambridge v. Dean, 300 Mass. 174 , 176 (1938), and does not represent its interest for purposes of c. 231A, Section 8. Compare Building Inspector of Wayland v. Ellen M. Gifford Sheltering Home Corp., 344 Mass. 281 , 286-287 (1962).
In addition, there is no indication in the record that the Attorney General was sent notice and given the opportunity to be heard as is required by c. 231A, Section 8, if "a question of constitutionality" is raised. "Such notice and opportunity are conditions precedent to the entry of a declaratory decree." Court St. Parking Co. v. Boston, 336 Mass. 224 , 226 (1957). See also Lowell v. Boston, 322 Mass. 709 , 740-741 (1948).
Since the plaintiffs have not complied with c. 231A, Section 8, we do not reach the other questions raised by the parties and the amicus curiae.