Re: WebObjects development
I can put it more succinctly than Chuck by saying that Chuck seems to me to have this right, front-to-back. Three comments: 1. There was a time when WebObjects fit Apple's business model as did, e.g., the Xserve product. That model changed, a lot, many years ago now. 2. I don't think the current die was cast 5 years ago, I think it was probably cast 10 or more years ago. 3. My reason for yielding to temptation: the best chance for WebObjects to succeed, in my opinion, would have been if it had been spun off from Apple back when customers were willing to put money down for server technology. If one had built a strong company around the technology and then moved the company forward as a solutions provider leveraging the technology, it is plausible that it might have a heartbeat and own a portion of the world today. Have those proposing to resurrect WebObjects at Apple contemplated what percentage of the current employees, including management, even worked for the company when WebObjects last generated revenue/profit for Apple? Off the cuff, I think their revenue has grown 20-40 fold since that time. Tom On Mar 7, 2014, at 8:06 PM, Chuck Hill wrote: > Unlike iOS and OS X, Apple does not own the server platform. Communication > is via standard protocols. And Apple is no longer in the server market. > Bringing back WO as a product is NOT going to sell more iPhones. It is NOT > going to make more money for Apple. Making a really good SDK and > development tool for iOS IS going to sell more iPhones. Apple may not do > what you want, but they are smart! They know a winning business model when > they see one. Unfortunately for those who appreciate it, WO just never had a > winning business model. Deal with it. > > Chuck > > > On 2014-03-07, 6:30 PM, "Jonathan Miller" wrote: > > It's all about iPhone and iPad sales and one of the things that makes Apple's > devices the best is the quantity and quality of the applications in the > platform. And the application server is an essential component to many iOS > and Mac applications with the prime example being iTunes. > > > On Fri, Mar 7, 2014 at 4:22 PM, Pascal Robert wrote: > > > Envoyé de mon iPhone > > Le 2014-03-07 à 21:05, Jonathan Miller a écrit : > >> I know you guys are right and I loathe to involve myself in this discussion >> but here goes nothing... >> >> Does Apple make a lot of money selling XCode? > > They make money by selling laptops to developers and by taking 30% of > revenues in the app stores. > >> It seems to me that WO is another tool that Apple could support that >> enables developers to make great applications for their platform. After >> all, the application server is an important component to many if not most >> iOS apps. >> >> my 2 cents... >> >> >> On Fri, Mar 7, 2014 at 3:36 PM, Nilton Lessa >> wrote: >> > >> > Em 07/03/2014, às 21:46, Pascal Robert escreveu: >> > >> > >> >> Le 2014-03-07 à 19:21, Aaron Rosenzweig a écrit : >> >> >> >> Am I right or what? WO is an elite “gentleman’s club” There are those “in >> >> the circle” and those outside. >> > >> > For the record, I’m not the one who contacted a senior VP. >> > >> >> If Mark wants to send a note of praise to someone, why not? Even if it is >> >> Tim Cook. Will anything bad come of that? It may fall on deaf ears but >> >> that’s ok. >> > >> > It’s just that every year, in the answers in the surveys, I still people >> > asking for something from Apple. Even if we said many times that Apple >> > management don’t give a damn. >> >> > >> >> Mark, I’m glad you love WO. >> >> >> >> For those who may wonder, I’ll summarize what I believe Pascal is >> >> alluding to: >> >> >> >> Even if WO sold very well, “well” would be a relative term. Compared to >> >> their other product lines, a good line of sales related to WO would mean >> >> nothing compared to Apple’s other product lines. How many developers are >> >> there in the world? Compare that to consumers. >> >> >> >> Apple does not need to make other programmer’s lives easier on the >> >> server. It would be nice but there is no need (for Apple). >> >> >> >> If Apple were to open source WO, it may mean they have less of an ace up >> >> their sleeve in negotiations with other companies when legal issues crop >> >> up. “You want to sue me for this? then I’ll sue you for your use of >> >> Key-Value-Coding so why don’t we just not sue each other ok?” Open >> >> sourcing WO could weaken Apple’s stance in legal battles for no monetary >> >> gain. >> >> >> >> The ONLY way to open source WO would be to buy it from Apple… but even >> >> then… it would have to be a lot of money to make it worth the legal >> >> trouble of figuring out if that is a good financial deal for Apple. >> > >> > And since a major group (iTunes) use it, not going to happen. But we could >> > open source it, by rewriting it and by replacing some stuff by >> > alternatives. >> Yes, I st
Re: Finding WO people for startups (cult of the dead)
I also prefer .html/.wod model because it's (close to) separating view and controller. I'm accustomed to receiving HTML from someone who, e.g., cuts the page, provides images, puts in pro-forma tags for active elements. The supplier is responsible to deliver a page (he wraps it in a little PHP) that is displayable and tested across browsers (I think he tests against 17 of them). I then insert the active elements, supply JavaScript, etc. I also may receive updates to the page in HTML (in which case I'm doing some kind of diff on HTML and update on HTML/wod). It looks to me as if this process is going to become a lot more work on my side and a lot more error prone if I go to this non-HTML/"single source" approach -- unless I get the HTML supplier to instead give me Seaside. Am I understanding this correctly? Tom On Sep 28, 2011, at 9:38 AM, arosenzw...@clinworx.com wrote: > Hi Chuck, > > I can feel your gears turning. That's a good thing! > > 1) PHP is nothing but a template file (with embedded programming) > > 2) WO has a template file, a programming file, and it also has "in-line" > binding which I've never been a fan of. Then there is the OGNL too... > > 3) Seaside is nothing but programming logic. > > So PHP is on one side and Seaside is on the other. WO is in the middle. > > We all can agree that the PHP, JSP, etc. way is a nightmare. You can make > good software but you have to work harder. > > WO way is better. For many years I really liked the way the .html / .wod was > nothing but presentation and bindings. OGNL is cool for quick and dirty but > it didn't feel right to me being too cluttered like the PHP way and hard to > debug. Inline bindings also clutter the HTML file and never resonated with me > either. Maybe... perhaps its cool for a WOString with a single value but > anything other than that... I'd rather someone use the .wod file. The Apple > way was insane, you had to do all inline bindings or none. The WOnder way is > best, able to mix the two. > > In WO there is the minor hassle of finding the line in HTML that matches up > with the .wod file. Using WOlips this is easy because it finds it for you and > jumps you right there to synchronize the two files in a split view. One thing > WOLips can't do is refactor that code. Only Java code is refactorable. You > also have to be extremely astute that you output correct and balanced HTML > > Seaside way is best. By using a living language, everything is immediate, you > don't feel the urge to cheat like with OGNL. By removing the template file > entirely and using objects you get so many benefits. > > 1) No extra files to coordinate. > > 2) no HTML syntax problems. > > 3) you can refactor ALL of your code, not just the business logic. > > 4) you can still partition your presentation logic - but instead of putting > it in a different file you put it in a method. > > 5) did I mention everything is alive? There isn't even a source code file to > deal with. No compiling, no interpreting static files, no need for an add-on > like JavaRebel. In Eclipse you can query for methods given part of a name you > remember. In Smalltalk you can query for methods that take such and such > parameters and evoke a certain value, you don't even have to know the method > name. Smalltalk will immediately give you a handful of methods that do > "greatest common denominator" for example. "Living" versus "Living Dead" > there is a difference but I digress. > > Here is an example of how presentation is rendered in Seaside. Bare in mind > that "renderContentOn" is akin to "appendToResponse". And that "html" is an > object which gets passed into the method that is a bit like a WOContext and a > String buffer rolled into one. In this example it is going to render an HTML > table with table rows and table data cells: > > renderContentOn: html > > html table: [ > html >tableRow: [ > html tableData: [html text: 'Table entry']]; >tableRow: [ > html tableData: [html text: 'Table entry']]]. > > Look foreign? Perhaps but it's worth getting your feet wet and kicking these > ideas around. I've seen many things and this is the first set of tools and > processes that make me feel good. Like it is equivalent and perhaps better > than WO. It's brain dead easy to install and there are a number of tutorials > out there. > > -- Aaron > > > > From:Chuck Hill > To:arosenzw...@clinworx.com > Cc:WebObjects Mailing List > Date:09/27/2011 06:02 PM > Subject:Re: Finding WO people for startups (cult of the dead) > > > > Hi Aaron, > > > On 2011-09-27, at 9:19 AM, arosenzw...@clinworx.com wrote: > > > What is cool about Smalltalk / Seaside with respect to WO? > > > > 5) Even better than "in-line" binding it has no template file what-so-ever > > by design. All your HTML output is coded in the programming language. No > > mo
Re: Malformed Cookies and WO
handleMalformedCookieString() provides the (cookie) string being parsed when the error occurred and the cookies it parsed successfully. If you have a better error recovery strategy, have at it. Tom On Feb 10, 2011, at 6:16 PM, Dov Rosenberg wrote: > Is there any way to just skip over the bad cookies and continue on - i.e. > Like if the malformed cookie is the third out of 5 cookies > > Thanks > > Dov Rosenberg > > > On 2/10/11 8:35 PM, "Peter Vandoros" wrote: > >> "Debugging" _WOCookieParser, an IllegalStateException is thrown when it >> encounters a problem. The exception is caught and >> WOApplication.application().handleMalformedCookieString() is called. in >> WOApplication.application().handleMalformedCookieString(), the initialisation >> parameter is checked and then returns the NSDictionary of already parsed >> cookies (if parameter set to true). >> >> This confirms that it does quit processing subsequent cookies on the first >> error encountered :) >> >> Regards, >> >> Peter >> >> On 11/02/2011, at 12:21 PM, Tom M. Blenko wrote: >> >>> >>> I had the flag running in production on one site for a couple of years (same >>> situation you mention) with no problems - I don't believe it just quits >>> parsing on a single error but I don't know. You might want use >>> WOApplication.handleMalformedCookieString(), which returns cookies >>> successfully parsed, if you want to check it out further or try to better >>> recovery yourself. >>> >>> Tom >>> >>> >>> On Feb 10, 2011, at 4:30 PM, Peter Vandoros wrote: >>> >>>> With the initialisation parameter you mention, I believe the CookieParser >>>> will stop parsing subsequent cookies once it encounters a malformed one. >>>> This means that if the malformed cookie happens to be the first one, as >>>> sent >>>> by the user's browser, then you application won't receive any subsequent >>>> cookies. This will obviously break the WO session handling via cookies. >>>> >>>> I'm not sure what to do other than "write" your own _CookieParser :) >>>> >>>> Regards, >>>> >>>> Peter >>>> >>>> On 11/02/2011, at 7:14 AM, Dov Rosenberg wrote: >>>> >>>>> We came across a strange issue that took a bit to figure out but thought >>>>> it >>>>> would be worthwhile to let everyone else know what happened >>>>> >>>>> Problem >>>>> Some users were having trouble saving a form (WOComponent based) >>>>> intermittently. Normally these kinds of problems are nearly impossible to >>>>> figure out unless you get lucky. We got lucky. >>>>> >>>>> Root Cause >>>>> Looking thru the log files we saw a handful of error messages that looked >>>>> like >>>>> >>>>> 410901380 [http-8228-Processor2] WARN er.extensions.appserver.ERXRequest >>>>> - >>>>> java.lang.IllegalStateException: Malformed cookie content: >>>>> >>>>> The default OOTB behavior of WebObjects is to throw an exception when a >>>>> malformed cookie is detected in the HTTP Request. This disrupts the normal >>>>> HTTP request/response loop which played hell with our WOComponent. >>>>> >>>>> The malformed cookie was being set by another web site in their domain >>>>> that >>>>> was using Google Analytics. Not sure what the problem was with the cookie >>>>> – >>>>> saw one that URL encoded 4 times over and another with a null value. >>>>> >>>>> Solution >>>>> Thankfully the WO folks realized that throwing an exception while >>>>> processing cookies might be a bad thing (default behavior) that they added >>>>> an initialization parameter to change the default behavior to something >>>>> more sensible. By setting WOAcceptMalformedCookies=true all cookies will >>>>> be >>>>> accepted but the malformed ones will be dropped and not processed. After >>>>> changing the default behavior our app stopped misbehaving. >>>>> >>>>> Not sure if changing the default behavior is a good thing from a security >>>>> perspective but it did resolve the error for us. Anyone have any
Re: Malformed Cookies and WO
I had the flag running in production on one site for a couple of years (same situation you mention) with no problems - I don't believe it just quits parsing on a single error but I don't know. You might want use WOApplication.handleMalformedCookieString(), which returns cookies successfully parsed, if you want to check it out further or try to better recovery yourself. Tom On Feb 10, 2011, at 4:30 PM, Peter Vandoros wrote: > With the initialisation parameter you mention, I believe the CookieParser > will stop parsing subsequent cookies once it encounters a malformed one. This > means that if the malformed cookie happens to be the first one, as sent by > the user's browser, then you application won't receive any subsequent > cookies. This will obviously break the WO session handling via cookies. > > I'm not sure what to do other than "write" your own _CookieParser :) > > Regards, > > Peter > > On 11/02/2011, at 7:14 AM, Dov Rosenberg wrote: > >> We came across a strange issue that took a bit to figure out but thought it >> would be worthwhile to let everyone else know what happened >> >> Problem >> Some users were having trouble saving a form (WOComponent based) >> intermittently. Normally these kinds of problems are nearly impossible to >> figure out unless you get lucky. We got lucky. >> >> Root Cause >> Looking thru the log files we saw a handful of error messages that looked >> like >> >> 410901380 [http-8228-Processor2] WARN er.extensions.appserver.ERXRequest - >> java.lang.IllegalStateException: Malformed cookie content: >> >> The default OOTB behavior of WebObjects is to throw an exception when a >> malformed cookie is detected in the HTTP Request. This disrupts the normal >> HTTP request/response loop which played hell with our WOComponent. >> >> The malformed cookie was being set by another web site in their domain that >> was using Google Analytics. Not sure what the problem was with the cookie – >> saw one that URL encoded 4 times over and another with a null value. >> >> Solution >> Thankfully the WO folks realized that throwing an exception while processing >> cookies might be a bad thing (default behavior) that they added an >> initialization parameter to change the default behavior to something more >> sensible. By setting WOAcceptMalformedCookies=true all cookies will be >> accepted but the malformed ones will be dropped and not processed. After >> changing the default behavior our app stopped misbehaving. >> >> Not sure if changing the default behavior is a good thing from a security >> perspective but it did resolve the error for us. Anyone have any thoughts on >> the impact of this change? >> >> Dov Rosenberg >> InQuira >> >> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/peter.vandoros%40gmail.com >> >> This email sent to peter.vando...@gmail.com > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/blenko%40martingalesystems.com > > This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cloud Computing and PCI Compliance
I've gone through a couple of what seemed to me like serious security audits (PCI compliance was not mentioned but a bank doing the audit using their internal standards). Two of the major areas were physical security of the systems and security checks on personnel with access to the systems and their data. I have asked someone in the cloud business how I could satisfy these requirements in a cloud and the upshot was that he didn't know of a way. On the other hand, some of those questions have a very vague interpretation, and others are just plain stupid (like asking if you have an anti-virus installed on all your company computers, or asking if you have a proper configured firewall, whatever that means). I'm not defending PCI here, just saying you can get burned. That's what the compensating controls section is for. The questions have an underlying risk that they try to protect against. In the case of antivirus software, it is to prevent the surreptitious installation of malicious or otherwise unauthorised software on your systems. If you can provide this security by other means then you detail it as a compensating control. That may be true for the anti-virus thing, but what about the Firewall? What's a correctly configured firewall? In what way the firewall prevents an attack using HTTP by exploiting a non-obvious bug in my app? Some of those questions seem irrelevant or misleading to me. It looks like some kind of "one size fits all" kind of certification which ends up being pointless. I would rather have people who can THINK writing the code where my credit card goes trough, than a firewall. I think this is a misunderstanding. One purpose of the questions is to provide a way for you to systematicly review your security. I don't think anyone expects a one-size-fits all solution for, e.g., the firewall configuration for all sites. I suppose that some of the people who put this together have orders of magnitude more experience with security and breaches and credit card data theft than I so there's value in seeing what they think is important. I don't need to argue with whomever tried to come up with the firewall question, I need to look at my setup and figure out what firewall configuration, for me/my customers, prevents breaches from occurring. To make the point more tangible, my understanding is that some credit card processors write into the contract that you or your employer or your customer is at risk for any breaches due to PCI non-compliance. Compliance, then, isn't a form-filling-out exercise, it's the definition of where the responsiblity lies if a breach occurs. It doesn't matter if you answered "Yes" to the question, it matters whether an incident occurs in which, it can be shown, failure to configure a firewall was a contributing factor. Tom ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Question about concurrent request handling
Even with concurrent request handling turned on, access to the database is serialized. Two backdoor ways of getting an additional EOF stack: Most long queries (after optimization) I've had were related to reporting. Moving the reporting to a separate application prevented the long query from interfering with more typical user access (and educated users' expectations). If the application is for use by a limited number of users, e.g., internal customers, increasing the number of instances may reduce the likelihood of other users waiting. Tom On May 4, 2010, at 3:17 PM, Ricardo J. Parada wrote: If I have concurrent request handling enabled and I have a query taking a long time, will other requests block when they try to access the database until the request that issued the long query finishes? Thanks, Ricardo ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Statistics
Try increasing the max Java memory size to see if that affects what you're seeing (if the slowing goes away or takes longer to appear, your working set probably exceeds the max memory). Tom On Apr 23, 2010, at 10:44 AM, Ricardo J. Parada wrote: Thanks... This is deployment... an app that got slow after a release... I'll take a look at ERXStatistics. Thanks! :-) On Apr 23, 2010, at 1:40 PM, Kieran Kelleher wrote: And of course, while ERXStatisticsStore can be used in deployment, in development you can use the new framework committed to Wonder recently by Mike ERProfiling On Apr 23, 2010, at 12:49 PM, Ricardo J. Parada wrote: Hi, What should I look at to find out the time a request sits in the queue before it is picked up and processed? Thanks, Ricardo ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists %40mac.com This email sent to kieran_li...@mac.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Statistics
I don't know how to find that. However, if you have a performance problem, I doubt this is what you want to know so if you do, perhaps you could post what the problem is you are trying to solve. Tom On Apr 23, 2010, at 9:49 AM, Ricardo J. Parada wrote: Hi, What should I look at to find out the time a request sits in the queue before it is picked up and processed? Thanks, Ricardo ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: SIF and WO
Don't know if this is helpful (it's not what you asked) but I had a project that needed to tie together a SIF source and a database and some other things. This was several years ago. SIF was a mess, datawise, and we concluded pretty quickly that the thing to do was to set up (like, daily) syncing between the (Oracle) database and the SIF data we needed. Everything not already going directly to SIF would use the database. I believe that we expected little or no writing back to the SIF source in this setup. There wasn't a SIF spec at that time and it probably didn't matter because the data reached back a number of years (I believe SIF emerged from a vendor implementation that was originally proprietary and, shall we say, ad hoc). The project never got built. Tom On Feb 1, 2010, at 7:53 PM, Steve Peery wrote: I am looking into linking an existing WO Application into a SIF Zone Integration Server. If someone has been down that path, they could make my life easier. If not, I will probably start asking some more specific questions in the near future. Steve On Feb 1, 2010, at 10:39 PM, Chuck Hill wrote: On Feb 1, 2010, at 7:32 PM, Steve Peery wrote: Has anyone used SIF, http://www.sifinfo.org, in a WebObjects project? No, but I have worked with this http://www.acord.org/Pages/ default.aspx which seems at least superficially similar. The Design by Committee aspect can yield a schema that is, er, hard to penetrate. I made some scripts and XSLT to transform the XML into an EOModel. It did not clarify anything, but then you are working with EOF and not XML. Was that the sort of thing you wanted to know? Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/speery%40me.com This email sent to spe...@me.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Modeling an optional to-one relationship
I'm happy to model an optional to-one as a to-many. It almost always results in a superior data model because it moves contention off the, e.g., Part, table. That is good and sometimes very good (my example is a User table with lots of rows and optional to-one's that grow like topsy as marketeers devise new user attributes to add). Good data design vs. the cost of a few lines of code for cover methods is a win every time. I think you need a better example because I'm left wondering how/when PartAttribute and Part rows get created and deleted. If some process outside your control is doing that the to-many is off the table and there are other issues that need to be addressed. If there aren't other processes outside your control, why not right the wrongs of the original design? Tom On Jan 13, 2010, at 4:01 PM, Lon Varscsak wrote: Okay, let me try to give an example (although a contrived example). Entity: Part (PK: partNumber) Entity: PartAttributes (PK: partNumber) It's a to-one relationship from Part to PartAttributes, but the part_attributes table doesn't have to have a row for a given part. If this were a to-many relationship this would result in just an empty NSArray. I want partAttributes() to return null. In the old days the only way to model this was to have a to-many relationship with methods that allow the user to access the data in a to-one way ([[somePart partAttributes] lastObject]). Or you could but an exception handler in: - (PartAttributes *)partAttributes { NS_DURING [partAttributes self]; //this would catch the exception thrown NS_HANDLER [partAttributes release]; //throws away the fault partAttributes = nil; //sets the ivar to nil NS_ENDHANDLER return partAttributes; } I was just wondering if this concept of a PK to PK to-one relationship was possible these days without jumping through hoops. For this example I probably wouldn't setup the tables this way in RL, but there are situations where it is valuable and when dealing with legacy table structures you don't usually have a choice. -Lon On Wed, Jan 13, 2010 at 4:49 PM, Chuck Hill village.net> wrote: Modelling it as FK to PK seems like the way to go, unless I am misunderstanding what you need. On Jan 13, 2010, at 3:24 PM, Lon Varscsak wrote: Yes it is the same PK in both tables but there are no rows in the relationship. This is a pretty common practice and I just hate modeling a to-many and then provide interfaces as a to-one. On Wed, Jan 13, 2010 at 4:14 PM, Travis Britt wrote: Short answer: no. Is the PK not really a PK? If it is a real PK, how are there rows without it? On Jan 13, 2010, at 5:53 PM, Lon Varscsak wrote: > Is there a way to model an optional to-one relationship from the primary key to a primary key of another object? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Garbage collection question
And the scope may be a larger scope than the one you define in your program, i.e., the variables in an inner block quietly be allocated/ released in an enclosing block. So you're always safe assuming the variable is good within the inner block but you can't assume it will be available for collection upon exit. You can also assume that variables recently allocated and released will be collected first, i.e., there is locality in the collector. (Variables in cyclic dependencies would be excepted.) This is useful because it means that memory collected when you don't expect it to often shows up reallocated shortly thereafter (much tougher to bracket the problem if it were delayed indefinitely). Overriding finalize() should tell what's really going on with aFoo (might leave you still wondering why). Tom On Dec 8, 2009, at 9:53 AM, Antonio Petri wrote: The object referenced by aFoo should only be garbage collected after the variable goes out of scope. If the editing context holds a strong reference to it, it shouldn't be garbage collected. 2009/12/8 Ricardo J. Parada Hi All, If I have a local variable that is assigned a value and never read after that, is it possible that it may get garbage collected before the block where it was defined. For example: public void someMethod() { Foo aFoo = new Foo(editingContext()); editingContext().saveChanges(); } Will aFoo live until the end of someMethod()? Or could it get garbage collected? I'm asking because in the real app, Foo is a delegate of the editing context when it gets created and it finishes its job when the editing context saveChanges() is called. But in a non-GUI app, we believe aFoo is getting garbage collected prematurely. Those are someone else's findings but I though I should ask to see if that is right. The documentation for NSNotificationCenter says the following: Note: If the default NSNotificationCenter is the last object in your application with a reference to either an object registered to receive notifications or an object being observed, that object will be garbage collected. P.S. Sorry if this is more a java question than a WebObjects question. :-) Thanks, Ricardo ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/antonio.petri% 40googlemail.com This email sent to antonio.pe...@googlemail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/blenko% 40martingalesystems.com This email sent to ble...@martingalesystems.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebObjects become opensource ?
As I understand it, NeXT (and now Apple) actually has a patent on KVC and O-R mapping ... I recall an O-R product (in fact an O-R company) as early as 1985. Can't remember the name of the company but they weren't alone and this should not be a surprise, given the importance/prevelance of databases and the emergence of object-oriented languages. I'm sure you can find the elements of KVC in Smalltalk -- therefore, I expect someone somewhere built the same/similar mechanisms on Smalltalk and therefore I expect there is prior art on any broad claims for the novelty of KVC. Patents aren't for suing, usually, and I can't imagine Apple suing over these ones (they're virtually irrelevant to its business). Tom ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Partially saving the object graph. How? (Jean Pierre Malrieu)
That's how I would do it (modulo addition of parentEC.saveChanges after childEC.saveChanges(), as pointed out by Chuck). Or, at least, that's how I'd try to do it... If you've ever used a child editing context on a page to avoid backtracking problems (or simply user-navigates-off-the-page-without-saving-after-creating-new-EO's problems), you've done the first half of this already. If the user navigates off the page without saving the childEC, the child EC is abandoned but the expectation is that the user will be doing a save of the parent EC, only, somewhere else. I'm guessing that the wariness is due to concerns about doing operations on the child EC after saving the parent. I haven't reread the docs but my recollection is that, if there are any changes seen in the parent, local instances in the child are supposed to be refaulted. Don't see any reason not to try it, it's not much code. "Trust the force, Luke". Beats the hell out of trying to do a heart-lung transplant on EOF. Tom On Mar 19, 2007, at 1:17 PM, Mike Schrag wrote: After discussing this with Chuck some, and only as a thought exercise, because neither one of knows if you will kill yourself (or destroy the universe) doing this. The only thing I can even think of that MAYBE will work (and I stress MAYBE, because I don't know the exact semantics of these uncommitted relationships across parent-child EC's): * create an editing context (call it parentEC) * create Company objects in parentEC * create a child editing context of parentEC (call it childEC) * local instance your new Company objects into the child editing context (which should be allowed because it's parent=>child) create your Employee objects in childEC that relate to the Company objects * parentEC.saveChanges(); Note: at this point, I have no idea if this works "right" ... TECHNICALLY, this should notify childEC that the local instanced Company objects now have real global ids instead of temporary ones, and it should become a "real" EO. What I don't know is what becomes of the new to-many relationships to your uncommitted Employee objects in childEC. Maybe this works fine. If it does, this is the only thing I can think of that does sort of what you want. * then sometime later: childEC.saveChanges() The catch here ("the" catch ... assuming catch #1 isn't "it doesn't work at all"), is that you'd have to know beforehand which objects you want to save and which ones you don't so you create them in the proper editing context. Or ... Just don't do this :) ms On Mar 19, 2007, at 3:52 PM, Chuck Hill wrote: On Mar 19, 2007, at 12:34 PM, Jean Pierre Malrieu wrote: Le 19 mars 07 à 18:25, Chuck Hill a écrit : Hi Jean, On Mar 19, 2007, at 10:13 AM, Jean Pierre Malrieu wrote: It depends on what you are doing with entity B. If you are not modifying any B objects, then you don't need to do anything because only updated/inserted/deleted objects in the editing context will get committed to the database. I am modifying them. I am inserting them, then modifying them. Most of the time, they are saved along with instances of entity A. But in one app of mine, they must not be saved. Then delete them. If you delete an inserted object, it will not be saved. Not possible. I need them after saving... I think you are in trouble then. If you are modifying A and B objects, then you can't just commit A changes because both A and B objects must be part of the same editing context. If this is what you need to do, then i think you might to reconsider your model. Rethinking the emodel is not an option here, I am affraid. You are going to have to re-think something! Basically, what gets committed is determined by the editing context you call saveChanges() on. This is what determines the DB transaction. Sure. I was wondering if the best strategy would be to override saveObject() in a subclass of EOEditingContext in order to skip entity B's inserts an updates. Would that entail violating EOF commandments? Here is what I would do. Go outside. Find a large road. Wait for a bus or large truck. Lie down in front of it. You will find this is quicker and less painful. :-) Not being very tall, and lying parallel to the road, I was hoping EOF bus would drive over me without hurting me... It might, but if that happens it will backup and try again. EOF's core focus is to maintain object graph consistency. Any effort on your part to prevent this will cause havoc. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help
Re: EO/Java class default Values
On Sep 27, 2006, at 1:49 PM, Zak Burke wrote: Tarun Reddy wrote on 9/27/06 4:18 PM: I assume that awakeFromInsertion (based on the name) does not execute until the actual insertion of the object in the database, which means I can't rely on the value until the object has been saved. I am currently using the method to store creation date info, but I was hoping to get an initial value in before being saved to the database. (Trying to generalize the EditIdea form for both existing objects that I'm editing, and newly created objects. Since the status field is effectively a selector of sorts, I would like to have it always populated, even before being saved to the database, for business logic checks.) This has been an interesting sort-of Best Practices thread to follow. I dunno if this is good or bad, but I always use static constructors for my EOs and I just do initialization there. I have code in my EOEditingContext subclass that sets date-created and date-updated fields in saveChanges(). This keeps the EO constructors clean but still lets me set default values. For example: public static SomeEO(EOEditingContext ec) { SomeEO eo = new SomeEO(); eo.insertObject(eo); eo.setDefaultString("foo"); // ... return eo; } The first two lines could be replaced by createAndInsertInstance(). This is just the pattern I fell into before I knew about that method. I've evolved from doing using awakeFromInsertion() to (frequently) using a variant of the above that I find more useful. Implement static creation/initialization methods in, e.g., Person, such as public static Person newPersonWithEmployer( ec, employer ) { return newPersonWithEmployerAndCreationDate( ec, employer, new NSTimestamp() ); } public static Person newPersonWithEmployerAndCreationDate( ec, employer, creationDate ) { Person person = new Person(); ec.insertObject(person); person.setCreationDate(creationDate); person.addObjectToBothSidesOfRelationshipWithKey(employer, "employer"); /* any additional initialization code goes here */ return person; } Advantages: 1. I have a habit of overlooking what happens in awakeFromInsertion() until I find myself debugging something. With this it's usually clear what's going on just by looking at the calling code. 2. I've forgotten to include super() in awakeFromInsertion() too many times, no similar issue here. 3. This approach provides a simple, clear way to support multiple initializers (unlike awakeFromInsertion()). 4. The method(s) can be shared throughout the program and eliminate the problem of inadvertantly doing slightly different initializations in different places. 5. Also because of sharing, it's easier to update initialization code as the EO changes. Update one file in one framework, no search required. I always include the ec as an argument but you could, in a case like this, get it from the employer. Tom ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com
Re: Session timeout and memory
3) Can someone point me at some good doc for learning about memory profiling of Java app's. Specifically over a long period of time. Even to figure out how much ram each session is taking and when that is being garbage collected as per Tom's example below. I've used OptimizeIt (http://www.borland.com/us/products/optimizeit/index.html), although not in its most recent incarnation, of which there have been several. I have also heard that JProbe (http://www.quest.com/jprobe) has seen plenty of use with WebObjects, although that might be a few incarnations ago as well. I am aware of JProfiler (http://www.ej-technologies.com/products/jprofiler/overview.html) although I haven't heard of it being used with WebObjects. The first two work by connecting to the VM's JVMPI (Java Virtual Machine Profiler Interface) ports. This slows the VM down a good deal. You wouldn't want to hook up to this in production and leave the profiler running for days until trouble appeared. Some ideas: - Check that sessions are indeed terminating. - I have no idea how much traffic you are seeing or what percentage of overall memory is leaking. However, you might determine how much memory per session is leaking -- that in itself might give you a clue as to the problem, especially if it's a lot. - Set up the app in development with a profiler attached. Set the session timeout to be short. Watch what happens, even with a nominal amount of activity on the session, especially as the session terminates. Also visit any suspicious areas of the application. Be aware that the garbage collector collects in its own sweet time, as I mentioned earlier. The problem is difficult in principal but, especially if the leak is large, it may be pretty easy to spot. I'd also give some consideration to periodically restarting instances. Not as a solution to a real memory problem but as insurance against your mission-critical application failing early Sunday AM. Tom ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com
Re: Session timeout and memory
What you are seeing is almost certainly just the way garbage collection works. When the session times out, the objects it allocated are available for garbage collection. They are not collected at that time, just made available for collection. The garbage collector won't run until it needs to. The latter is not correct. The garbage collector on HotSpot runs frequently and a common occasion is when a response has been returned by a WO application. It appears that it collects on these occasions against the local store. This makes sense in the immediate context, you'd probably have to test it against you own applications to determine whether it makes sense on balance. (I don't believe you can control this behavior in any case). The garbage collector doesn't collect all available memory on these occasions, however. I had a disagreement with someone once about whether the garbage collector would collect a cycle, which it isn't difficult to create, e.g., off of a session. We put up a minimal application on a quiet machine, instrumented the VM, set the session to timeout after 1 minute, requested one page (which created the cycle), and waited. The garbage collector ran many times but it took 10 minutes before the cycle was collected. Behavior of the garbage collector isn't an issue most of the time. If the working set is close to the VM memory size, however, it can cause the VM to thrash and the solution is (usually) to increase the size of VM memory. It can also happen that you know when a sizable chunk of memory is being freed and forcing the gc to run amounts to an optimization, e.g., to reduce paging or total memory use. You can call gc() to advise the garbage collector to run. You can call gc() three times in succession to advise it more strongly to run. Running, in this circumstance, will only cause it to collect what it chooses, it won't necessarily collect all the memory available. Tom Chuck On Sep 11, 2006, at 11:18 PM, Ute Hoffmann wrote: Ok, perhaps I'm looking at the wrong thing. This is the piece of code which I use to determine the used memory: Runtime runtime = Runtime.getRuntime(); double nochVoranden = new Double(runtime.totalMemory () - runtime.freeMemory ()).doubleValue(); So this happens to the logs: The memory goes up inside of the session. It sometimes drops a bit but it mainly goes up. So there seems to be a memory leak somewhere... Ok, but then the session is terminated or times out. So I would assume that then the memory is returned as free memory. So the next session should again show used memory lets say 6 MB. But when the previous session had a used memory of lets say 50 MB the next session (created well after the first session is timed out or terminated) will show 50MB + of used memory. And yes: There was only one session present in the testcase and it clearly went up after the first session was timed out without releasing this used memory. Do I have to schedule the instances to get rid of this (as it happens by design) or does it point me to a memory leak in my code which means whatever holds the memory cannot be released even after the session is terminated. Regards Ute Anfang der weitergeleiteten E-Mail: Von: Q <[EMAIL PROTECTED]> Datum: Di, 12. Sep 2006 01:43:35 Europe/Berlin An: Chuck Hill <[EMAIL PROTECTED]> Cc: Ute Hoffmann <[EMAIL PROTECTED]>, webobjects-dev@lists.apple.com Betreff: Re: Session timeout and memory On 12/09/2006, at 2:26 AM, Chuck Hill wrote: In addition to garbage collection which has been mentioned, be careful of what you are looking at. If additional memory is allocated to the JVM process, it will not be returned to the operating system until the JVM process terminates. In other words, the total heap size will never decrease but free memory on the heap will vary as objects are created and the garbage collector runs. Chuck It should also be pointed out that this is a good thing not a liability that needs special consideration, because it means that the JVM doesn't need to constantly malloc and free memory. Provided there isn't an actual leak causing the JVM size to continually grow unexpectedly, the virtual memory allocation shouldn't be something to really worry about, as any vm pages that go unused for long enough will eventually get paged out by the OS should the physical memory be required for something else. Assuming your OS has got enough swap allocated. -- Seeya...Q -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- _ / Quinton Dolan - [EMAIL PROTECTED] __ __/ / / __/ / / /__ / _// /Gold Coast, QLD, Australia __/ __/ __/ / / - /Ph: +61 419 729 806 ___ / _\ ___ Do not post admi
Re: The shirts are having an impact!
You misunderstand, Arturo's asking for a picture. Tom On Aug 9, 2006, at 2:12 PM, [EMAIL PROTECTED] wrote: On Aug 9, 2006, at 1:58 PM, Arturo Perez wrote: Not being there, I can't help but wonder why they are noticing you. That is, why are you THE woman wearing the WebObjects shirt? Are you the only woman with a shirt? Are you the only woman at WWDC? Are you the only WebObjects-shirt wearing woman?D o they think you are working a booth? What's the deal? Are you 7 feet tall? What? As far as I know I'm the only woman wearing the shirt. There's one other here who wore one on Monday, but it was covered by a vest so it wasn't very visible. I haven't seen her since so I don't know if she has continued to wear it. The guys haven't been wearing their WO shirts either since Monday so I'm pretty much the only person in the whole place who is wearing one. There is nothing else special about me, so I'm guessing it's just the uniqueness of the shirt. janine ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/ blenko%40martingalesystems.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com
Re: Help with code screen using model-view-controller
Does anyone know of a good reference or examples that can demonstrate model-view-controller? I have found WO apps to be much more difficult to model using MVC than Cocoa apps. Maybe one reason is because WO is a server-side technology (ignoring Java Client :-) so Views aren't so obvious. But one could probably argue that dynamic element classes that generate UI elements on a Web page are View classes. A typical WO app probably doesn't contain many custom dynamic element classes, so the main MVC modeling challenge is probably between Controllers and Models. But maybe a bigger problem is that WebObjects Builder supports easy mixing of Model and Controller. I look at Model classes as those that contain logic that manipulates data without any assumption about the display of that data. Controller classes are the glue between Models and Views. So for me, custom WOComponents are Controllers. However, WOBuilder supports associating data directly with UI elements, so the data model is exposed to the WOComponent. I tried to fight this at one point by not typing custom WOComponent keys (i.e., instance variables and methods) as custom data types (i.e., those property types specified in an eomodel) instead creating Model classes that custom WOComponent methods would invoke for data to display and to set data values. That was a painful process that resulted in much more bug-prone code. So I gave up on strict Model and Controller separation. I don't see the problem -- but perhaps I'm stuck with seeing things through my own habits (I am strongly in favor of MVC but I think it means what you find it means in the technology you are using). MVC Cocoa looking a bit different than WebObjects seems unsurprising. (Views in WebObjects applications have very different lifetimes than typical views in Cocoa applications, for starters). I agree with Chuck that .wod+WOComponent is the controller. I think this addresses your WOBuilder issue. I rarely have trouble deciding where something goes. If I want to fetch all the Users, or all the Users subject to some qualifer, I can implement methods for fetching (and generating the qualifier) in User. If I want to cache the result, I'll do that on the page/in the controller. Or occasionally on the Session (a super-controller for the page) for, e.g., content shared across pages. I admit to creating qualifiers, sometimes, or doing subselects using filteredArray(...), in the controller. Or using EOUtilities methods directly on the page when I could create a simple wrapper for them in, e.g., the User class. If I use the same fetch or qualifier twice then I will move it to User. So perhaps those are MVC violations but I attribute them to laziness, not to confusion about MVC in a WebObjects setting. The in-memory subselect as a model method seems a little odd because I want to do the selection on an NSArray that has been fetched via User and then cached on the page.I have to pass the NSArray back to the User method to do the subselect. Doesn't look unreasonable from the User side, though: what it implements is perfectly logical and does not depend on the caching property implemented by the controller. So I say it separates the properties well between the controller and the model and that's the way it should be. Looking through some actual model classes here, I find myself importing com.webobjects.appserver to load WOCookie, or com.webobjects.eoaccess to get access to EOUtilities. Maybe a small error by the designers, or perhaps they had something a little different in mind in sorting these out. I'm not bothered by this. So what is a concrete example of a problem that doesn't have a clear MVC separation in WebObjects? Tom ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com