Sunday, February 26, 2012

Domain Driven Design, Grocery Lists, and Node.js

To begin building this grocery list system, we need to first establish some of the baseline requirements and the domain model.  First, we have npmnvm, and the latest node environment installed.  Next, install jasmine node (this, with the latest version of npm, can be done via npm -g install jasmine-node, at least on a mac).  I'm also going to use Jake, which installs via npm as well.

Now that we have the requisite tools installed, we build the project directory.  I like to use a pretty common structure stolen from Ruby projects I've worked on in the past, with a the subdirectories bin, etc, lib, and test, with a README and a makefile of some kind at the top level of the directory structure.  The Item entity is pretty straightforward:


It defines an item with a name and a description. We may elaborate on this in the future, but it's fine for now.

Likewise, we're going to use a named collection of objects:

The idea behind this simple collection is that folks will want to name their lists, and so we've provided a way for a JavaScript array to be named. Next time, we'll go over the tests in place to exercise these objects, and we'll delve into the command line interface. Eventually, we will host this service on Heroku, and initially at least we'll access that service via the command line interface we develop.

27 comments:

  1. I am trying to develop my server-side JavaScript code using domain driven design. Do you any book or material that could help me with it, like designing entities, aggregates, bounded contexts.

    ReplyDelete
  2. Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. Iranian Grocery Store

    ReplyDelete
  3. HostGator offers website hosting services around the world in more than 202 countries. Furthermore, you can get services of web hosting, reseller, and VPS hosting according to your needs. Additionally, They offer dedicated servers hosting services.hostgator coupons

    ReplyDelete
  4. If You are not - You will have to select domain name from those, which are being sold as vacant. Here is what You should take into consideration while choosing a domain name:about

    ReplyDelete
  5. Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.. printable wall art

    ReplyDelete
  6. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on
    updating...

    Guest posting sites
    Technology

    ReplyDelete
  7. Before you leave on picking a location for your site, it is qualified to take note of that picking a Search motor inviting names gives you a decent driving force to make progress on the web. buy domain

    ReplyDelete
  8. VPS represents virtual private servers so these servers essentially offer the earth of a devoted server inside a mutual server. webmoney rdp

    ReplyDelete
  9. You should oversee design extends by embraced a demonstrated stage by stage process.Webdesigner Website Voor Professionele en Betaalbare Websites

    ReplyDelete
  10. In the first place a logo is something which potential clients could search for when picking items or administrations and they are unquestionably bound to choose something which incorporates a logo they know over something which does not convey one. logo design service

    ReplyDelete
  11. you will understand that a significant number of the individuals which you found over this locales, will get in touch with you last for some extra work (on the off chance that you worked alright just because) - so you will begin to construct your normal customers. Webdesigner

    ReplyDelete
  12. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! web design agency

    ReplyDelete
  13. It is in view of that that we have composed this article.Webdesign

    ReplyDelete
  14. The emphasis on positioning sites was on being found for Large watchwords. Webdesignlab

    ReplyDelete
  15. At the point when you are maintaining a web design business, it is significant for you to comprehend that your customers are the a vital part of your business. Webdesign

    ReplyDelete
  16. The crawlers that these motors use presently are refined sufficient that any new site will be found surprisingly fast, if not hours.Webdesign bureau

    ReplyDelete
  17. Prior to figuring out how to turn into a web designer, you ought to ask yourself, "Would it be a good idea for me to turn into a web designer?"Web Development Agency

    ReplyDelete
  18. Owns comprehensive EFI/UEFI boot option management functions, such as create, delete, edit, clean up, backup, and restore EFI/UEFI boot options, .Easyuefi License Code

    ReplyDelete
  19. Happy NYE Wishes | 2023 Messages | Inspirational Quotes | Blessings | Bible Verses | Funny | Family | Friends | Boss & Co-workers | Text/SMS .May God Bless You With Good Health And Long Life Quotes

    ReplyDelete