Code Monkey home page Code Monkey logo

Comments (2)

cf-gitbot avatar cf-gitbot commented on July 21, 2024

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: http://www.pivotaltracker.com/story/show/64510302

from cli.

tjarratt avatar tjarratt commented on July 21, 2024

@drnic this is an absolutely great question and I'm glad that you're asking it.

One big win from generic.Map is that it has a .Has(key) method which allows you to test for the existence of a key in the map and determine whether an integer (for example) is actually zero because the user said "set this to zero" or if that was set by default.

I also think (but am not certain) that manifests are slightly more complicated than a single struct could capture. We support inheritance in manifests, parameters for an application can be provided at the top scope, or for a single application and we also validate the contents of manifests so we can provide helpful error messages to users. The flexible, generic interface Map provides made these features fairly easy to implement. Manifests are really surprisingly complicated -- did you know that the v5 cli had a random number generator for manifests?

There are some higher-order functions built up around generic.Map -- namely Merge and Reduce -- that have been helpful, but I fear they may be slightly too clever and may prove to be difficult to maintain as the requirements around manifests change. Excessive use of this generic.Map pattern is probably a code smell -- I'd think twice before introducing it to more structured models with a well defined schema.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.