<bdo id='dqPb6'></bdo><ul id='dqPb6'></ul>

    <small id='dqPb6'></small><noframes id='dqPb6'>

      <tfoot id='dqPb6'></tfoot>
    1. <i id='dqPb6'><tr id='dqPb6'><dt id='dqPb6'><q id='dqPb6'><span id='dqPb6'><b id='dqPb6'><form id='dqPb6'><ins id='dqPb6'></ins><ul id='dqPb6'></ul><sub id='dqPb6'></sub></form><legend id='dqPb6'></legend><bdo id='dqPb6'><pre id='dqPb6'><center id='dqPb6'></center></pre></bdo></b><th id='dqPb6'></th></span></q></dt></tr></i><div id='dqPb6'><tfoot id='dqPb6'></tfoot><dl id='dqPb6'><fieldset id='dqPb6'></fieldset></dl></div>

      <legend id='dqPb6'><style id='dqPb6'><dir id='dqPb6'><q id='dqPb6'></q></dir></style></legend>
    2. 一个类应该与命名空间同名吗?

      Should a class have the same name as the namespace?(一个类应该与命名空间同名吗?)
    3. <i id='1rk3f'><tr id='1rk3f'><dt id='1rk3f'><q id='1rk3f'><span id='1rk3f'><b id='1rk3f'><form id='1rk3f'><ins id='1rk3f'></ins><ul id='1rk3f'></ul><sub id='1rk3f'></sub></form><legend id='1rk3f'></legend><bdo id='1rk3f'><pre id='1rk3f'><center id='1rk3f'></center></pre></bdo></b><th id='1rk3f'></th></span></q></dt></tr></i><div id='1rk3f'><tfoot id='1rk3f'></tfoot><dl id='1rk3f'><fieldset id='1rk3f'></fieldset></dl></div>
    4. <small id='1rk3f'></small><noframes id='1rk3f'>

        <tbody id='1rk3f'></tbody>

          <bdo id='1rk3f'></bdo><ul id='1rk3f'></ul>
          <legend id='1rk3f'><style id='1rk3f'><dir id='1rk3f'><q id='1rk3f'></q></dir></style></legend>
              1. <tfoot id='1rk3f'></tfoot>

              2. 本文介绍了一个类应该与命名空间同名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在设计一个命名空间来保存一组类,这些类将为多个不同的应用程序处理与 用户 相关的任务.(登录、验证等)

                I'm designing a namespace to hold a set of classes that will handle user related tasks for a several different applications. (Log-in, authenticate etc)

                问题是命名空间将被称为 Fusion.User 但它需要该命名空间中的一个类才能调用 User.

                The problem is the namespace will be called Fusion.User but then it requires a class in that namespace that makes sense to call User.

                你应该有一个与命名空间同名的类吗?还是我在这里采取了错误的方法?

                Should you have a class with the same name as the namespace? Or am I taking the wrong approach here?

                推荐答案

                以与命名空间(包)相同的方式命名类可能会导致认为类是包的核心.但如果我理解正确,用户只是你的数据对象.

                Having class named in the same way as the name space (package) may lead to a thought that class is central to the package. But if I get it correctly User is just a data object in your case.

                据我所知,您有两个选择:

                As far as I see you have 2 options:

                1. 以不同的方式命名您的名称空间,例如Fusion.Security
                2. 使用类名的后缀来表明其用途,例如UserDTO、UserAction 等.

                这篇关于一个类应该与命名空间同名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                IBM.Data.DB2.Core connection problems(IBM.Data.DB2.Core 连接问题)
                Datetime field overflow with IBM Data Server Client v9.7fp5(IBM Data Server Client v9.7fp5 的日期时间字段溢出)
                Using entity Framework with .NET Core and DB2(将实体框架与 .NET Core 和 DB2 结合使用)
                IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)

                <small id='5H7gv'></small><noframes id='5H7gv'>

                <legend id='5H7gv'><style id='5H7gv'><dir id='5H7gv'><q id='5H7gv'></q></dir></style></legend>

                <i id='5H7gv'><tr id='5H7gv'><dt id='5H7gv'><q id='5H7gv'><span id='5H7gv'><b id='5H7gv'><form id='5H7gv'><ins id='5H7gv'></ins><ul id='5H7gv'></ul><sub id='5H7gv'></sub></form><legend id='5H7gv'></legend><bdo id='5H7gv'><pre id='5H7gv'><center id='5H7gv'></center></pre></bdo></b><th id='5H7gv'></th></span></q></dt></tr></i><div id='5H7gv'><tfoot id='5H7gv'></tfoot><dl id='5H7gv'><fieldset id='5H7gv'></fieldset></dl></div>

                  <tfoot id='5H7gv'></tfoot>

                          <tbody id='5H7gv'></tbody>
                          <bdo id='5H7gv'></bdo><ul id='5H7gv'></ul>