
377 Mass. 616 (1979)
387 N.E.2d 143
JOHN DOE
vs.
JANE ROE.
Supreme Judicial Court of Massachusetts, Suffolk.
February 5, 1979.
March 23, 1979.
Present: HENNESSEY, C.J., QUIRICO, BRAUCHER, KAPLAN, & ABRAMS, JJ.
William B. Golden for the plaintiff.
Danielle E. deBenedictis for the defendant.
KAPLAN, J.
From a statement of agreed facts we learn the following. The plaintiff and the defendant, a young man and a young woman, were students at school in the Commonwealth in 1977. Their parents resided in New Hampshire. They had been "dating" since 1976 and were engaged to be married in the fall of 1977. In October, 1977, the engagement was terminated. Sometime in November, 1977, the defendant informed the plaintiff that she was seven months pregnant. The plaintiff remained solicitous while the defendant sought out some prenatal care and counseling, and the two attended a counseling session at a denominational institution in Boston.
*617 A child was born to the defendant at a Boston hospital on January 27, 1978. Prompty, on February 1, the plaintiff formally asserted responsibilities of fatherhood under G.L.c. 210, § 4A. His paternity has been acknowledged as well by the defendant.
On January 31, 1978, the defendant entered into a "contract" with the institution for temporary foster placement of the child and the child was placed with a couple until February 24, 1978, when the defendant, having first informed the plaintiff, removed the child to her parents' home in Windham, New Hampshire, where it has remained. The defendant now also resides there.
The plaintiff at present attends a school in Boston, but by agreement has visited the child every other week in Windham; on those days he spends time with his parents who also live in Windham. The plaintiff has offered to make a contribution to the maintenance of the child but he has been refused.
On March 8, 1978, the plaintiff commenced the present action in the Probate Court for Suffolk County to secure custody of the child, or, it may be assumed, lesser parental rights, particularly visitation, if the defendant were to retain custody. The same day, in-hand service of summons and complaint was made on the defendant in Boston.
The defendant moved on the foregoing agreed facts to dismiss the action, nominally for lack of "jurisdiction over the subject matter." The motion was granted by a judge of the Probate Court and judgment of dismissal followed. We granted direct appellate review.
The terminology of subject matter jurisdiction is awkward here, as it points to "competency"  whether the court has been vested by the Legislature with power to decide cases of given substantive content, e.g., contract, tort, custody of children. See Restatement of Judgments § 7, Comment b (1942). But since the decision of Gardner v. Rothman, 370 Mass. 79 (1976), it has been clear that our Probate Courts are authorized to handle conflicting *618 claims of unmarried parents to the care or custody of their child. This follows from the language of G.L.c. 215, § 6, first paragraph, vesting general equity jurisdiction in the Probate Courts. It is another question whether, of all the States of the Union, this Commonwealth through a court competent in custody matters can constitutionally exert judicial power over a particular lawsuit of that sort, and, if it can, whether it should.
As indicated in Green v. Green, 351 Mass. 466, 469 (1966), originally it was conceived that custody proceedings belonged in the State of domicil or presence of the child. But, particularly after the influential exposition of the subject by Traynor, J., in Sampsell v. Superior Court, 32 Cal.2d 763 (1948), a third basis came to be regarded as possible and as constitutional, namely, "personal" jurisdiction over the contestants, usually the parents. The Restatement (Second) of Conflict of Laws § 79 (1971) accepts the three alternative grounds of judicial jurisdiction.[1] These ideas have been employed largely in custody cases relating to children born in wedlock, but comparable, although possibly not identical, notions appear relevant to "illegitimate" children.
A reading of Green v. Green, supra at 470-472, and Gil v. Servizio, 375 Mass. 186, 191 (1978),[2] shows that we have not been unfriendly to the possible assumption of jurisdiction of a custody case on the basis of personal jurisdiction of the litigating parties even though the child might be located elsewhere. But surely we should not insist on exercising such jurisdiction whenever permissible as a matter of due process of law. Rather we should deal with *619 the question as a prudential one which invites a careful examination of the relation of the lawsuit to the Commonwealth, including such issues as access to evidence and convenience of management or administration; and it should count against assuming jurisdiction that there is another State better situated to deal with the matter. The Green case, at 472, is congenial to this view. As the Conflicts Restatement observes (§ 79, Comment a): "This is not to say ... that a court which has jurisdiction on any one of these [three] bases will necessarily entertain the suit. A court of the state of the child's domicil will usually do so because of the obvious interest of this state in the child's welfare. On the other hand, a court of a state where the child is only physically present at the time will refuse to entertain the action unless it believes this to be necessary for the best interests of the child. A suit may likewise be dismissed if the court has reason to believe that its decree would not be effective as might be the case if both the child and the defendant parent are in another state." Actually the whole trend of the law is, or ought to be, to pay less attention to formal jurisdictional tests and more to functional or pragmatic considerations about the comparative advantages of one forum over another.[3] Indeed this calculus of interests tends to become determinative of the constitutional question itself.
The child in the present case was born in Boston. It is possible to say that the child resided in the Commonwealth for twenty-eight days. The parents were also here at the time. All that, however, is past history. It is true that the defendant was served with process in Massachusetts. We need not decide whether the latter formal *620 contact with the Commonwealth, combined with the earlier  and now rather irrelevant  associations here, would enable the Probate Court to pass a judgment in a custody case that would be constitutionally defensible. Cf. Kulko v. Superior Court, 436 U.S. 84 (1978); Shaffer v. Heitner, 433 U.S. 186 (1977). If that question were decided in the affirmative, it would not conclude the case. The child was brought to New Hampshire in no surreptitious way, and is living with its mother in that State. As a practical matter, the advantage in conducting a lawsuit about the interests of the parties in this child, and in producing a sensible and manageable judgment regarding custody or visitation, lies not with our courts but with the courts of New Hampshire. The inconvenience to the plaintiff, as a student in Massachusetts, of attending in New Hampshire, if there be any, appears quite outweighed by other factors. In reaching this conclusion we have attached no weight to the statements of counsel in course of argument before us that the plaintiff has actually commenced duplicating proceedings in New Hampshire. (Counsel were invited to elaborate on these statements if they could agree to do so; they have not agreed.) The plaintiff ventures to doubt whether New Hampshire has a law about his custodial rights as favorable as the law of Massachusetts, but he does not establish a difference, and we doubt its pertinence in any event. We put to one side the question whether a Massachusetts court, if it undertook to hear this custody action, might not be inclined in the circumstances to apply the law of New Hampshire, whatever it might be. See Alton v. Alton, 207 F.2d 667, 678, 684-685 (3d Cir.1953) (Hastie, J., dissenting), judgment vacated and cause remanded with directions to dismiss as moot, 347 U.S. 610 (1954). Cf. In re Ritchie, 58 Ill. App.3d 1045, 1049-1050 (1978).
Thus we agree with the judge of the Probate Court in dismissing the action and need not say whether the disposition is strictly required, or should be regarded as made in the exercise of discretion.
Judgment affirmed.
NOTES
[1]  Section 79 provides: "Custody of the Person. A State has power to exercise judicial jurisdiction to determine the custody, or to appoint a guardian, of the person of a child or adult (a) who is domiciled in the state, or (b) who is present in the state, or (c) who is neither domiciled nor present in the state, if the controversy is between two or more persons who are personally subject to the jurisdiction of the state."
[2]  Neither case is directly in point but both refer to the jurisdictional question, the Green case at some length.
[3]  The Uniform Child Custody Jurisdiction Act (1968), 9 U.L.A. 103 (1973), not adopted in Massachusetts, defines jurisdiction on a detailed, functional basis (§ 3), but, even so, provides for rejection of jurisdiction for reasons of inconvenience of forums (§ 7). See Comment, 54 Tex. L. Rev. 1008 (1976). Where the jurisdictional basis of an action is pragmatically sound, the chances of recognition of a judgment by other States should be improved. See § 13.
