Apple Retail Store Yorkdale?

Granted I don’t have any inside information, but I was at the Yorkdale Shopping Centre for lunch today and they had a big sign that said "40 New Stores – Spring 2005". The area that used to be occupied by Sears (which has now moved to a new location at the other end of the mall), the old cinemas, and the little bit of parking lot in between is being turned into a new corridor of shopping. So, if the reports of a Toronto Apple Store are true, I guess that’s where it will be.

WebObjects thoughts.

  1. Don’t fight the tool – WebObjects and EOF are very flexible and rich in capablilites. Get to know the way they work and work with them. Don’t fight them – they will win. Read the sample code from Apple and the source for Project WONDER. When you write your code emulate their style. The really good stuff is just below the surface (Key Value Coding for example). That’s where the power lives, dig a little, you will be rewarded.
  2. Follow the commandments – A few simple rules that will prevent a world of hurt.
  3. Let someone else write the code – I’ve mentioned a number of sources of WebObjects frameworks in my posts (Project WONDER, SwitchableStrings, WOCode ). They provide an amazing amount of functionality that you don’t need to implement yourself, that’s the entire point of OO design isn’t it? Also, when you build something useful, factor it out into your own reusable framework – why would you want to write something twice? Finally, use EOGenerator – no really – use it. There is no excuse not to.
  4. Model it right the first time – Every time I’ve been tempted to cut corners on my model, it’s come back to bite me. A strong Model will allow your App to almost write itself. My general rule of thumb: If I can’t get from one object to a “related” one via KVC, I’m going to be grumpy.
  5. If it is getting complicated, you’re probably doing it wrong
    • You’re fighting the tool aren’t you?
    • Maybe WebObjects is the wrong tool.

    Please, don’t try to hack around the WebObjects architecture. i.e. If you really need multiple concurrent access to your database everywhere in your application – use something other than EOF.

Using EOGenerator with WOLips/Eclipse 3.0

I use EOGenerator extensively when working with WebObjects. In WOLips/Eclipse 2.0 I had a GenerateEOs task in my build.xml file (I copied it from a post by Chuck Hill to the WOProject mail list). Unfortunately, it no longer works in WOLips/Eclipse 3.0. There is a WOGen Ant task that should be able to duplicate what EOGenerator does, but well, I’m just stuck in my ways.

As suggested on the WOProject list, I configured EOGenerator to run as a Builder for my project using the following steps:

  1. Select the appropriate Project/Framework in the Eclipse Package Explorer
  2. Select Properties from the Project menu and then select Builders
  3. Click the New button
  4. Configure the fields in the the window as follows:
    • Name: EOGenerator
    • Location: /Developer/Applications/eogenerator/eogenerator
    • Arguments: (shown on separate lines for clarity only)
      • -model ${project_loc}/superduperproject.eomodeld
      • -destination ${project_loc}/src/ca/codebase/substrate/
      • -subclassDestination ${project_loc}/src/ca/codebase/substrate/
      • -templatedir /Developer/Applications/eogenerator/
      • -javaTemplate CBJavaSourceEOF5.eotemplate
      • -subclassJavaTemplate CBJavaSubclassSourceEOF5.eotemplate
      • -define-copyrightYear “2003 – 2004”
      • -define-copyrightBy “Codebase Software Systems”
      • -verbose
      • -java
  5. Click Apply

Notes:

  1. ${project_loc} is an Eclipse variable (it contains the path to the project).
  2. I keep eogenerator and it’s templates in a folder in /Developer/Applications/ and my EO’s are in the ca.codebase.substrate package, change the paths above to reflect your environment.
  3. In Build Options for the Builder, select when you want to Run the builder. I find the defaults (After a “Clean” and During Manual Builds) are fine for my needs.