[01:18:59] gbay|Zzz is now known as gbay [04:03:52] [connected at Wed Apr 7 04:03:52 2004] [04:03:52] <> *** Looking up your hostname... [04:03:52] <> *** Checking ident [04:03:53] <> *** Found your hostname [04:04:25] <> *** No identd (auth) response [04:04:25] <> *** Your host is wells.freenode.net[wells.freenode.net/6667], running version dancer-ircd-1.0.35 [04:04:25] [I have joined #peak] [04:04:25] ** wells.freenode.net set the topic to peak - Python Enterprise Application Toolkit | http://peak.telecommunity.com | alpha3 is out !!! [07:03:27] jack-e|away is now known as jack-e [09:04:44] ** sremington has joined us [09:11:25] ** sremington has left IRC ("Laugh while you can monkey boy!") [09:39:37] ** vlado has joined us [09:45:42] ** sremington has joined us [10:00:37] ** sremington has left IRC (Remote closed the connection) [10:27:17] ** Maniac has joined us [10:27:18] hola [10:33:13] hey maniac :) [10:50:10] ** sremington has joined us [11:09:45] ** vlado has left IRC ("Leaving") [11:45:11] bye [11:45:18] jack-e is now known as jack-e|away [11:49:29] bye [12:55:23] ** gpciceri has joined us [13:38:34] ** rdmurray has joined us [15:08:58] ** panix has joined us [15:10:16] anyone around? [15:18:27] ** vlado has joined us [15:20:04] well, just in case anyone ever glances at the screen I will go ahead and spew my question into the void [15:20:30] I am an experienced python developer who has stumbled upon PEAK recently and I am attempting to grok all the various parts and pieces [15:20:49] and I am trying to find some decent examples beyond the very simple ones that I have seen in CVS. [15:23:18] http://peak.telecommunity.com/DevCenter/IntroToPeak. It doesn't have anything other than simple examples, but it gives a more gentle introduction to some of the concepts. [15:24:29] s/gentle/comprehensible/ [15:24:52] yeah, I read that already :) [15:25:07] k, I'm afraid I can't help you, then. [15:25:11] I was really looking for something that related to the event/message-oriented stuff. [15:25:12] PEAK is still young. [15:25:35] I noticed that, but I really like many of the constructs thus far [15:25:43] and I am interested in getting involved [15:25:49] have to understand the codebase first :) [15:26:07] The best thing to do is post a question to the mailing list. If you give some specific example, PJE will probably give you a good outline of the answer. [15:26:21] *nod* [15:27:10] I wrote Intro in order to learn PEAK. Unfortunately life has gotten in the way and I haven't been able to do more on it/learn more PEAK for a while. And probably won't be able to get back to it for another month or two. [15:27:27] I can understand that [15:27:41] peak rocks! [15:27:43] * Maniac hides [15:28:12] * rdmurray points to Maniac as someone who at least has a piece of running code using PEAK :) [15:29:35] * rdmurray goes out for a walk to get a new disk drive. [15:30:04] :) [15:37:31] anyone here have any clue on implementing metakit connection/storage with peak ? metakit does the things little different than sql servers do them and i'm not sure what exactly do i have to do [16:02:45] panix: Maniac pointed out http://peakplace.tigris.org/ to me at one point in time. Don't know if it is the type of code you are looking for. [16:03:10] sremington: I looked there once, and didn't actually see any code on it [16:03:24] panix: I had to get it from the CVS [16:03:55] panix: I remember having trouble locating it myself [16:04:11] yeah, I see it now [16:04:15] I will check it out, [16:04:17] thanks [16:04:51] panix: no prob [16:23:42] ** panix has left IRC (Remote closed the connection) [16:44:23] ** pje has joined us [16:47:27] vlado, what do you want your metakit component(s) to do? [16:53:52] in metakit there's no need to commit every time i add anything to the db [16:55:58] i can add data and it will live in the memory, and i want to commit only once, on exit [16:57:09] * pje isn't seeing what the problem is, then. [16:57:26] I mean, if you want to commit, commit a transaction. If you don't, then don't. [16:58:16] If you want changes from a DM to influence the in-memory state of an underlying storage mechanism without committing, call the DM's 'flush()' method. [16:58:41] (I'm making a whole bunch of assumptions about your intent, based on little info here) [16:58:48] howdy pje [16:58:56] Hola. [17:02:47] hm... if i want to get some obj from someDM i have to begin and then commit the transaction how do i avoid that ? [17:04:45] sorry, my EN is just terrible [17:06:04] Why do you have to commit to *get* the object? [17:06:05] does metakit use sql? [17:06:56] ** sremington has left IRC ("Laugh while you can monkey boy!") [17:07:11] ok, it doesn't look like it does [17:07:36] Just begin the transaction... and then commit once you're done with *everything*. [17:07:46] You don't have to begin and commit for every operation. [17:07:54] well... [17:08:16] But, the changes are buffered in the DM, and won't be applied to MK unless you call DM.flush() [17:08:37] flush() is called automatically when you commit the txn, but you can also call it as many times as you want *during* a transaction. [17:09:31] ah [17:09:46] thx [17:12:09] I'm guessing that the problem you've been running into is that you make chagnes to an object, but the changes don't show up in MK queries unless you commit, right? [17:12:49] That is the exact scenario that the flush() method exists for: to write out changes to another transactional storage in mid-transaction, so that queries to the underlying storage will be consistent. [17:13:12] (This use case is sometimes important for SQL databases as well) [17:19:26] i haven't done anything yet. we use MK with out own OR mapper. i really like peak and i wondered what to do to make it possible to switch to peak [17:25:22] ** Maniac has left us [17:26:26] yes, that's the pb i was thinking [17:27:16] but looks like it's not a problem [17:32:26] peak.storage was designed with that scenario in mind. [17:32:52] But, for a remote DB like an SQL DB, one usually wants to batch updates to an object, rather than write them as you set each attribute on an object. [17:33:28] The only issue with that is that then reporting-style queries can be wrong, if done in the same txn with a modification. [17:34:05] So flush() fixes that. And I think that there's a class that automatically calls flush() for you, when needed... [17:34:22] I think it's QueryLink... when it goes to load a multi-valued (list) attribute. [17:35:34] Nope. I was wrong. [17:37:04] You have to have the QueryDM flush any EntityDM's it loads objects for. [17:38:08] * pje is becoming disillusioned with object-relational mapping in the general case, anyway [17:39:59] word [17:40:08] I'm evolving a "Facts-Events-Rules" model that's more natural and flexible. [17:40:43] Combining ORM (Object Role Modelling) with an event-based communications, and predicate dispatch rules. [17:41:08] I had hoped to make major progress by now, but I've been (and largely continue to be) swamped at work. [17:41:11] it sounds like an orm by any other name.. how would it differ? [17:41:27] besides implementation of course [17:41:37] The primary concept is the "fact". [17:41:57] Like "User hazmat is on Channel #peak" [17:42:24] * hazmat starts to see the rdf triples ;-) [17:42:31] ok [17:42:44] ORM facts are n-ary, actually, not triples. [17:42:53] That one was a "binary fact". [17:43:07] with two "object holes" (of types User and Channel) [17:43:19] The really big things that ORM fact-orientation provides are: [17:43:40] 1) Superb constraint modelling. Beats everything in UML and every other system of constraints I've seen, hands down, absolutely no contest. [17:44:11] 2) "reference" orientation - objects always have some reference value by which they are identified. [17:44:36] (One of the big issues in mapping objects to data and back is that pure object references don't have an identifier.) [17:45:09] To put it another way, you can fill in a web form with reference values (e.g. "user name"), but you can't fill one in with objects! [17:45:31] So, fact orientation means no impedance mismatch. [17:45:35] another Q, i want to make a querydm that get the db cursor (which in the case with MK isn't exactly a cursor, it's more like a list) and then rewrap it in another "obj cursor" that makes it possible to get prev/next obj and return it instead of what it currently returns (i'm not sure), do you see anything wrong with that ? [17:45:50] events come into play where? on addition/modification of a fact? [17:46:12] hazmat: add/remove, yes. And then rules apply to events. [17:46:13] are model constraints enforced by rules triggered via events? [17:47:01] vlado, I'm not sure I follow your intent. QueryDM's want to map to persistent lists. [17:47:27] If you want a cursor-like thing, you don't really need a DM, just write a function or method that returns an iterator or cursor of the kind you need. [17:47:45] If you want to rewrap data as objects, you use the EntityDM.preloadState() method. [17:48:03] preloadState lets you pass in the data that will be used to construct the object's state, if it's not already in memory. [17:48:25] Thus, it ensures that there is only one instance of a given object in the database, and with any in-memory modifications applied. [17:48:55] hazmat: so, one kind of rule of course would be to trigger updates to a database... [17:49:20] Log things... send mail... invoke web services... etc. [17:49:47] sounds interesting, re f-e-r, i'm not sure that i really understand the nature of facts within the system... perhaps a concrete an example of how would one model a fact given a two related tables would be helpful [17:50:13] Any experience w/Prolog? [17:50:45] This is actually simpler than Prolog, because it's English. [17:50:59] a little from a cs class, i've been doing some constraint programming in python as of late to a dependency engine.. but i remember the basics [17:51:19] Okay, here are two facts: [17:51:36] User "hazmat" has Name "Kapil" [17:51:45] User "hazmat" is on Channel "#peak" [17:51:59] The first fact type is 1-1, the second is 1-many [17:52:08] So, in an SQL database there'd be two tables. [17:52:30] The "fact types" of those two facts are: [17:52:45] User(id) has Name(string) [17:52:54] ah [17:52:57] User(id) is on Channel(id) [17:53:22] thats cool [17:53:25] Or "User(userid) is on Channel(chanid)", more likely [17:53:36] The constraints would be something like: [17:53:45] a User has exactly one Name [17:53:55] ** gpciceri has left IRC ("Client exiting") [17:54:09] And no constraint for the other fact type, because it's many-many. [17:55:02] Actually, I think the constraint should've been "each User has exactly one Name" [17:55:34] And really, the fact type would've been better phrased: [17:55:45] User(userid) is named String [17:56:13] But I'm not very practiced at this sort of modelling yet. :) [17:56:18] so very much like prolog except no need to solve against statements/fact_types and facts.. how would you go about populating facts, at that point it seems like your close to the some of the same issues with orm, in terms of lazy loading of facts to solve constraints [17:56:59] Well, the improvement over a pure relational model is that you still have object types... [17:57:25] So, you can define bidirectional fact types with shortcut names, similar to how peak.model has bidirectional associations... [17:57:38] e.g. Channel.members vs. User.channels [17:58:05] ok [17:58:06] But, unlike a pure object model, it's relatively straightforward to map fact types to SQL queries. [17:58:47] Because as long as you can map any given fact type to an N-column query, you're set to retrive something from either end, include multiple output values, etc. etc. [17:59:43] And you can do very complex queries by chaining fact types: [18:00:17] User(x) is on Channel that has member User("hazmat") [18:00:30] to find anybody who's sharing a channel with you. :) [18:00:38] Assuming we restate our fact type thus: [18:00:54] User(userid) is on/has member Channel(chanid) [18:01:07] The / means that the part after is the inverse relationship. [18:01:22] (i.e. Channel(chanid) has member User(userid) is the inverse) [18:01:56] * hazmat is sold [18:02:01] Yet another ORM advantage: UoD's or "universes of discourse" [18:02:22] I can build up different fact type vocabularies that may map down to the same database-level objects. [18:02:57] So, I could perhaps have a workflow system that knew certain things about "User(hazmat)", that were different things than we know in the IRC "UoD" [18:03:19] And in principle I could then issue queries across those universes of discourse. [18:05:04] And if queries can also be subscribable event sources, then you can do GUI's with multiple views on the same "fact". [18:05:41] The nice bit is that the relationship between objects is preserved. If I say that 'x.y' is 27, the 27 is not connected in any way with 'x'. [18:06:02] But, in a fact-orientation, you instead have a fact "Object x has a y of 27". [18:06:36] And if you change that fact, then things that are looking at either object x or y's of 27 will find out. [18:07:09] And by things I mean GUI's, business rules, validators, replicators, notifiers... [18:07:55] Unfortunately, the open source world hasn't really picked up on this concept yet, so there are no tools. [18:08:15] There are some free-as-in-beer modelling tools for Windows, and also some for-pay ones. [18:08:43] But they are mainly diagram-drawing and verbalization, they don't actually do query translation or generate OO models from an ORM schema. [18:08:59] At least, not the free ones. :) [18:09:41] * hazmat looks up orm tool [18:09:45] One *really* cool bit about ORM is that you can write your model in a language your users can understand. [18:10:19] Literally: the ORM syntax is "mixfix", meaning you can use any language as the glue between the "object holes" in the sentences. [18:10:46] The textbook I'm reading on this stuff has a few examples in both English and Japanese. [18:11:27] (Although they do using a Latin alphabet for the Japanese) [18:11:33] Er, use, even. [18:13:43] hazmat: the free ones are Infagon and VisioModeler [18:14:19] pje, many thanks [18:14:20] i'm not on windows.. mac and linux ppc... but i'm just reading for background material on orm at the moment [18:14:37] Try http://orm.net then [18:14:56] vlado, no problem. Let me know if you have any more questions. If I'm not here, just write to the list. [18:15:10] ok [18:16:07] pje, it sounds promising, i've been disillusioned with most of the mapping tools when it comes to adapting to complex existing databases (most with little by way of rhyme or reason) [18:16:10] thanks [18:16:55] That site has lots of papers on the concepts, links to various articles etc. [18:18:15] Oh, and here's an introduction to modelling using FORML: http://www.niii.kun.nl/~gerp/IS0/dictaat/4a_Guide_to_Forml.pdf [18:18:44] It illustrates both the visual and verbal notation. [18:37:30] ** rdmurray has left IRC ("User disconnected") [19:38:46] ** vlado has left IRC (Read error: 54 (Connection reset by peer)) [19:39:36] ** vlado has joined us [19:42:05] * pje waves. See y'all later. [19:42:27] ** pje has left IRC ("Client exiting") [20:06:08] ** vlado has left IRC (Read error: 54 (Connection reset by peer)) [20:06:18] ** vlado has joined us [20:12:38] ** vlado has left IRC (Read error: 54 (Connection reset by peer)) [20:12:56] ** vlado has joined us [20:25:56] ** rdmurray has joined us [20:51:34] ** vlado has left IRC (Read error: 104 (Connection reset by peer)) [20:52:10] ** vlado has joined us [21:54:10] ** waterbug has joined us [21:54:11] ** vlado has left IRC (Read error: 104 (Connection reset by peer)) [21:54:34] ** vlado has joined us [21:55:51] hi gang! newbie question: i see the twisted support, but has anyone tried using twistd with peak? [21:56:38] I'm pretty sure the answer is yes, but I don't who or what bits they used :) [21:57:02] ah, well thanks -- that's some info anyway! [21:57:16] ** hazmat has left IRC (Read error: 110 (Connection timed out)) [21:57:22] Post the mailing list. PJE will let you know where the support currently stands. [21:57:39] I know he was fiddling with it a couple months ago. [21:57:59] okay, just thot i'd check here first ... :) seeya later! [21:58:11] ** waterbug has left IRC (Client Quit) [22:06:15] ** hazmat has joined us