objective c - Simple Drawing App Design -- Hillegass Book, Ch. 18 -


I'm working through Aaron Hillegos Coke programming Mac OS X and I challenge Chapter 18. Actually, the challenge is to write an app that can pull the egg using your mouse, and additionally, add saving / loading and undo support. I am trying to think of a good class design for this app which follows MVC. Here's what I did:

is an NSV-subclass, which represents an oval (called jabwal), which I can easily attract an oval. There is a main scene (JBDrawing Weave) which holds and stores Jebows.

The thing is that I was not sure how to add the collection. Should I collect every jebwal? I think this will work, but collecting an NSView does not seem very efficient any ideas on better class design?

Thanks

is an NSView-subclass that is an oval (JBOval ), Which I can use to easily draw an oval.

It does not sound like MVC "JBOval" looks like a model class for me.

There is a main view (jb dropping weave) that holds the jawballs and pulls them.

I have to do this part.

I recommend that each model object (Jabwal, etc.) be able to represent a lifeless path themselves. JBDrawingView (And you should come up with a better name for that, because all ideas should be drawn according to the definition) Each model object should fill its unstable path, setting, and ask for stroke settings, and accordingly Drag the object.

It keeps knowledge of how they come in different shapes classes (path, line width, color, etc.), where it is related where keeping the actual visual code in the level of viewing.

The answer to inserting the collection point should be clearly evident from this point.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -