Mathieu Tozer's Dev Blog

Cocoa, the development of Words, and other software projects (including those dang assessment tasks).




Groups: A New Sub Project


E-mail this post



Remember me (?)



All personal information that you provide here will be governed by the Privacy Policy of Blogger.com. More...



(Sorry about all the blogging these past few days, I've just been rather active!)
New Project: Groups
I'm starting a new sub development app for Words called Groups in light of what I discussed in my last post.
This would also reduce the run / execute cycle too.

Data modelling. Here's what I propose.
Group is an object that an application can have many of, but a language can only have one group object associated with it.
A group object can have many ManualGroups associated to it, and many smart groups associated to it.
A language can have many words associated to it.
A ManualGroup maintains a list of words that are 'in it'
A SmartList maintains a fetch predicate of words that are 'in it'.

Group, ManualGroup and SmartGroup will be managed by NSManagedObject subclasses which will prove the functionality. The model simply shows who owns what.

Should also create the 'library' smart group programatically at first instance too.

When you 'add' a new group, whether it be a smart or manual, you have to set it's association to the currently selected language's group object.

All these entities will need to be managed with some controlling arrays. That's essentially what they are.

I have set up a groupObjectController in IB to hold whichever instance of Group is active.

I'm getting a bit lost.

Ok.

When you create a new language object, it needs to create a
1. Group object for itself
2. A library smartyPantsGroup object for itself too.
3. Any other default smart groups.
4. The word welcome as the language's new word.

So let's start from there. Subclassing Language to get a feel for what it needs to do, and cascading from there we'll need additional objects and methods which will force us to subclass the other entities in the model.

Heyheyhey! I just discovered a powerpoint in my makeshift Mac Lab with my toe as I stretched! Hooray.

I'm now wrestling with this idea of what the GroupController should be called, because I'm not sure exactly how it will function.
The groupController has to present to the UI a list of all the manual and smart groups that are associated with the Group object that it is controlling. It's an array, but it's probably not ...

When the user clicks addSmartGroup, the message is going to be sent to the groupController, which will
1. Create a new instance of the SmartGroupEntity.
2. Associate this newSmartGroup to itself (toManyRelationship).
3. Somehow show the user a representation of this newSmartGroup in the group list.
4. Set the wordArrayController to answer to the newSmartGroup.

Or am I using the entirely incorrect structre?
Should I, like the CoreRecipes example, make it so that
- Languages can have many group objects, which are managed by a regular NSArrayController
- But a group object can be either a smartgroup or a manualgroup. We don't care which.

Might I create a branch of my new groups project and do this.

Groups is now an abstract entity, whenever you go to create one of these, you actually create a smartList or a ...

damn. Now I just thought of another stucture!

What about if languages themselves can have many smart lists and manual lists, and then I have a subclassed NSArrayController that simply pushes these around?
--
I got three-thirty-itis around 3.30 and went home... I might have another crack at it later.


0 Responses to “Groups: A New Sub Project”

Leave a Reply

      Convert to boldConvert to italicConvert to link

 


+RSS | dev blog | Portfolio

About me

My status

Previous posts

  • my del.icio.us
  • my flickr