Common vs Core - difference












7















Assume We have couple of libs. What is the difference between core and common library. How should be recognized and organized the responsibilites of both.



+Common
-Class1
+Core
-Class2
+Lib1 has : Common
+Lib2 has : Core, Common


Should Common be trurerly common(all libs use it)? Or is common only for those who need it?



What is good practice when refactoring / creating project?



I'm not really feel the diferrence between Core and Common.










share|improve this question




















  • 2





    Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

    – Jon
    Apr 19 '15 at 20:30
















7















Assume We have couple of libs. What is the difference between core and common library. How should be recognized and organized the responsibilites of both.



+Common
-Class1
+Core
-Class2
+Lib1 has : Common
+Lib2 has : Core, Common


Should Common be trurerly common(all libs use it)? Or is common only for those who need it?



What is good practice when refactoring / creating project?



I'm not really feel the diferrence between Core and Common.










share|improve this question




















  • 2





    Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

    – Jon
    Apr 19 '15 at 20:30














7












7








7


1






Assume We have couple of libs. What is the difference between core and common library. How should be recognized and organized the responsibilites of both.



+Common
-Class1
+Core
-Class2
+Lib1 has : Common
+Lib2 has : Core, Common


Should Common be trurerly common(all libs use it)? Or is common only for those who need it?



What is good practice when refactoring / creating project?



I'm not really feel the diferrence between Core and Common.










share|improve this question
















Assume We have couple of libs. What is the difference between core and common library. How should be recognized and organized the responsibilites of both.



+Common
-Class1
+Core
-Class2
+Lib1 has : Common
+Lib2 has : Core, Common


Should Common be trurerly common(all libs use it)? Or is common only for those who need it?



What is good practice when refactoring / creating project?



I'm not really feel the diferrence between Core and Common.







naming






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 21:42









jaco0646

5,24952846




5,24952846










asked Apr 19 '15 at 20:25









PuchaczPuchacz

91021228




91021228








  • 2





    Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

    – Jon
    Apr 19 '15 at 20:30














  • 2





    Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

    – Jon
    Apr 19 '15 at 20:30








2




2





Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

– Jon
Apr 19 '15 at 20:30





Good practice: do things that make sense, don't violate the principle of least surprise without a really good reason. You are not feeling the difference because it is an arbitrary decision.

– Jon
Apr 19 '15 at 20:30












1 Answer
1






active

oldest

votes


















11














I think this depends a lot on your particular application. In a single centralized app, I do think there might be a little overlap between the Core and Common folders. But the most important thing is that it makes sense for your app. Don't feel that you need to have those folders just because you've seen it in other apps...



For me, having a Core and a Common folders makes a lot of sense in some scenarios - e.g. a web app with an API and a client. You may have your Core folder in the API side, where the core execution (the business logic) takes place, and then have a Common folder with some things you need in both the API and the client sides - e.g., Http requests validation or a Json converter.



Anyway, it may make sense to have a Core and a Common folder in other kinds of apps.

For example, the Core folder would contain those classes that are central for your app - the vast majority of business model classes would be there.

In the Common folder, on the other hand, you can have some other classes that are shared, but not central - e.g., a Logger or a MessageSender could be there...



As for your little draft of code structure, I think that your Core package is the one to be revised - why Lib1 doesn't use Core? If something is core, generally it's because everything else needs it in order to run. If you do not have code that is conceptually central, maybe you can remove your Core package and keep only Common?



As for your other question - I do not think the Common stuff must be shared by all other packages, but just with 2 or more packages sharing something, that can be considered common.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29735406%2fcommon-vs-core-difference%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11














    I think this depends a lot on your particular application. In a single centralized app, I do think there might be a little overlap between the Core and Common folders. But the most important thing is that it makes sense for your app. Don't feel that you need to have those folders just because you've seen it in other apps...



    For me, having a Core and a Common folders makes a lot of sense in some scenarios - e.g. a web app with an API and a client. You may have your Core folder in the API side, where the core execution (the business logic) takes place, and then have a Common folder with some things you need in both the API and the client sides - e.g., Http requests validation or a Json converter.



    Anyway, it may make sense to have a Core and a Common folder in other kinds of apps.

    For example, the Core folder would contain those classes that are central for your app - the vast majority of business model classes would be there.

    In the Common folder, on the other hand, you can have some other classes that are shared, but not central - e.g., a Logger or a MessageSender could be there...



    As for your little draft of code structure, I think that your Core package is the one to be revised - why Lib1 doesn't use Core? If something is core, generally it's because everything else needs it in order to run. If you do not have code that is conceptually central, maybe you can remove your Core package and keep only Common?



    As for your other question - I do not think the Common stuff must be shared by all other packages, but just with 2 or more packages sharing something, that can be considered common.






    share|improve this answer






























      11














      I think this depends a lot on your particular application. In a single centralized app, I do think there might be a little overlap between the Core and Common folders. But the most important thing is that it makes sense for your app. Don't feel that you need to have those folders just because you've seen it in other apps...



      For me, having a Core and a Common folders makes a lot of sense in some scenarios - e.g. a web app with an API and a client. You may have your Core folder in the API side, where the core execution (the business logic) takes place, and then have a Common folder with some things you need in both the API and the client sides - e.g., Http requests validation or a Json converter.



      Anyway, it may make sense to have a Core and a Common folder in other kinds of apps.

      For example, the Core folder would contain those classes that are central for your app - the vast majority of business model classes would be there.

      In the Common folder, on the other hand, you can have some other classes that are shared, but not central - e.g., a Logger or a MessageSender could be there...



      As for your little draft of code structure, I think that your Core package is the one to be revised - why Lib1 doesn't use Core? If something is core, generally it's because everything else needs it in order to run. If you do not have code that is conceptually central, maybe you can remove your Core package and keep only Common?



      As for your other question - I do not think the Common stuff must be shared by all other packages, but just with 2 or more packages sharing something, that can be considered common.






      share|improve this answer




























        11












        11








        11







        I think this depends a lot on your particular application. In a single centralized app, I do think there might be a little overlap between the Core and Common folders. But the most important thing is that it makes sense for your app. Don't feel that you need to have those folders just because you've seen it in other apps...



        For me, having a Core and a Common folders makes a lot of sense in some scenarios - e.g. a web app with an API and a client. You may have your Core folder in the API side, where the core execution (the business logic) takes place, and then have a Common folder with some things you need in both the API and the client sides - e.g., Http requests validation or a Json converter.



        Anyway, it may make sense to have a Core and a Common folder in other kinds of apps.

        For example, the Core folder would contain those classes that are central for your app - the vast majority of business model classes would be there.

        In the Common folder, on the other hand, you can have some other classes that are shared, but not central - e.g., a Logger or a MessageSender could be there...



        As for your little draft of code structure, I think that your Core package is the one to be revised - why Lib1 doesn't use Core? If something is core, generally it's because everything else needs it in order to run. If you do not have code that is conceptually central, maybe you can remove your Core package and keep only Common?



        As for your other question - I do not think the Common stuff must be shared by all other packages, but just with 2 or more packages sharing something, that can be considered common.






        share|improve this answer















        I think this depends a lot on your particular application. In a single centralized app, I do think there might be a little overlap between the Core and Common folders. But the most important thing is that it makes sense for your app. Don't feel that you need to have those folders just because you've seen it in other apps...



        For me, having a Core and a Common folders makes a lot of sense in some scenarios - e.g. a web app with an API and a client. You may have your Core folder in the API side, where the core execution (the business logic) takes place, and then have a Common folder with some things you need in both the API and the client sides - e.g., Http requests validation or a Json converter.



        Anyway, it may make sense to have a Core and a Common folder in other kinds of apps.

        For example, the Core folder would contain those classes that are central for your app - the vast majority of business model classes would be there.

        In the Common folder, on the other hand, you can have some other classes that are shared, but not central - e.g., a Logger or a MessageSender could be there...



        As for your little draft of code structure, I think that your Core package is the one to be revised - why Lib1 doesn't use Core? If something is core, generally it's because everything else needs it in order to run. If you do not have code that is conceptually central, maybe you can remove your Core package and keep only Common?



        As for your other question - I do not think the Common stuff must be shared by all other packages, but just with 2 or more packages sharing something, that can be considered common.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 20 '15 at 13:03

























        answered Apr 20 '15 at 10:04









        MikOMikO

        13k105990




        13k105990
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29735406%2fcommon-vs-core-difference%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues