Oop 孪生静态和实例方法

Oop 孪生静态和实例方法,oop,class,static-methods,instance-methods,Oop,Class,Static Methods,Instance Methods,我有一门课,像这样,简化了: public class Bookmark { public string Nav { get; set; } public string Scroll { get; set; } public string Comment { get; set; } public string guid() { return guid_static(this.Nav, this.Scroll); }

我有一门课,像这样,简化了:

public class Bookmark
{
    public string Nav     { get; set; }
    public string Scroll  { get; set; }
    public string Comment { get; set; }

    public string guid()
    {
        return guid_static(this.Nav, this.Scroll);
    }

    public static string guid_static(string nav, string scroll)
    {
        // some complex equations on nav & scroll
        return result;
    }
    ...
}
在类之外,我需要同时启动(实例和静态)方法。 First-获取现有书签的guid。 第二个-为特定“位置”(导航和滚动值)生成guid,该位置不是书签(尽管没有实例)以与另一个guid进行比较

就OOP概念而言,这两种方法行吗?或者我必须引入一个新类,比如“Position”,它只有guid()方法?难道没有一个“正式的”面向对象解决方案吗?(我只是不想把班级数量相乘)


另外,如果可以的话,孪生静态方法和实例方法的命名约定是什么?

如果愿意,实际上可以将它们都命名为“guid”。大多数语言会自动知道调用guid()与guid(nav,scroll)之间的区别,因为方法签名不同。您当前对其进行编码的方式也很好