--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm embarking on a new project and I think spec can be a central component not just to the developer-users of the system but to my end-users as well. I'm thinking of providing something like a graphical mechanism to describe specs in EDN to bring spec goodness to user created data pipelines. My only concern is the global registry. Quickly browsing spec alpha-17's code, it appears the that global registry is an implementation detail of the map spec and, perhaps, others.Would it make sense to provide an additional arity for the conform*, unform* and explain* fns which take a user-supplied registry?
Can you explain why you think this is the case Mark?
We use spec heavily in production (and have been doing so for months) so I’m not following your logic here I’m afraid…
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
I'm interested in the answer to whether it is just an accident of implementation or if there is some compelling reason for the global registry.
On Mon, Jun 12, 2017 at 12:37 PM, Mark <markad...@gmail.com> wrote:I'm a bit surprised by this. It seems that the use of the global registry limits spec to development use cases. Is that intentional? Maybe I'm worried over nothing
So, you would give all those end-user-created specs a unique namespace prefix which identified them as part of your application. As Alex indicated, spec is predicated on the use of appropriately qualified names, so that they have global meaning.
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
I think it's your responsibility to make specs "sufficiently unique". Prefixing with a standard namespace you control seems like it would work.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/4jhSCZaFQFY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
If you’re building a multi-tenant system, then this is not how you do it:
> One customer wants :org/postcode to be integer (i.e. US) and another wants it to be string (i.e. UK)
In a multi-tenant system, you have very few “global truths” and for _anything_ that an end-user may touch, it is not a “global truth” by definition. Therefore you _must_ partition per-user specs either by process (entirely) or via their user ID (or similar) so that they absolutely cannot clash.
Also, remember that all of the clojure.core specs _are_ global truths – so they can’t have a different meaning for each user and, more importantly, your system must not allow an end user spec to be created that overwrites a clojure.core spec (and that’s _your_ responsibility when designing a multi-tenant system).
It is the responsibility of the multi-tenant system to manage loading and unloading of per-user specs, not just “leave it up to the JVM”.
To be honest, if you want per-user isolation on a per-ETL-job basis, your best bet may be to spin each job off in its own JVM container anyway since different jobs could require radically different JVM configurations and resources. That also ensures you can’t have any in-memory data conflicts.
This is no different from multi-tenant databases: you either completely partition your per-user data (separate databases/schemas) or you ensure that the user ID is part and parcel of every single key reference into the data store.
(for reference, we have a multi-tenant system that runs around 100 different websites with millions of unique user accounts, so keeping per-user data isolated while allowing for certain global shared resources goes with the territory)
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
On Jun 12, 2017 4:55 PM, "Alex Miller" <al...@puredanger.com> wrote:I think it's your responsibility to make specs "sufficiently unique". Prefixing with a standard namespace you control seems like it would work.pls excuse me for butting in, but i wonder what happens when i require 14 namespaces and 7 of them register foo.bar/baz in the global registry? who wins? we don't have this prob with vars; if i require foo.bar and foo.baz, and they both define x, no prob. but spec namespacing is different, no? the namespace you use for a spec is independent of the ns in which you define/specify it. which defeats the purpose of namespacing. clojure namespacing is controlled; spec namespacing is not. which leads me to think that maybe spec registries should be namespaced, just like everything else.
If you’re building a multi-tenant system, then this is not how you do it:
Yes, I think most of the problems can be solved through prefixing (although the solution is a bit hacky, IMO) but the real problem with the global registry is that its not based on an abstraction but a concrete implementation. The only specific problem I can think of right now is the incidental complexity related to garbage collection - like Steve points out.
If the registry were based on an abstraction, I can imagine a few fun experiments. Right now, the implementation assumes that the registry is loaded when a namespace is initialized. Why not load the registry from a database, edn files or off the network? Piling onto the network idea, why not have a true global registry which gets updated as Clojure developers publish specs in real time?
(derive tag parent)
(derive h tag parent)
(swap! h (derive tag parent))