Attracted by virtual constructs

November 17, 2007

Fine grained access control to class methods?

Filed under: KDE,Okteta — by frinring @ 1:02 pm

One year ago I showed a first picture of Okteta, a successor to KHexEdit in-work. Time to show a new one, here it is:

No changes in the UI of Okteta yet

Well, no big changes in the UI, except for the style and the color. Still looking similar to KHexEdit (which it shall in the default settings, to easen moving over).

But under the hood things are developing. Created a framework called Kakao which serves as a template for programs, so one just needs to plug in factories for documents, views, and tools to get a full featured program for your $datamodel. Currently I am laying grounds for the concept of model synchronizers. Something I have been looking for since ages, really, how can our allday-programs just be without it? Right now I am trying to map the action “Save as…” to it, meaning something like switching the synchronizer, if the remote data model is different (e.g. PNG->JPG for stream formats), or only the location/url. Why is there no option with today’s “Save as…” actions to remove the old remote data model (like old file) BTW? Sometimes one just wants to move/rename a file or recode it, while working on it. Is this workflow so unusual?

An interesting problem is:
How can one limit access to a subset of methods of a class for only certain other classes in C++? I can define friend class Class; for access to all protected methods. But I would like to declare different friends for different subsets of the protected methods. So only the synchronizer classes could call void setRemoteHasChanges( bool hasChanges ); or similar for document subclasses, not some nasty plugin doing dirty things. I imagine I could play some tricks with subclassing abstract classes, but those methods don’t need to be virtual. Is there a better way?

No time to take part in things like Krush Day, me bad boy, I am just too fascinated by the possibilities I see coming with the Kakao framework!

About these ads

6 Comments »

  1. hello,

    One question about oketa: will it load the files you are editing in memory ? If it does, it becomes impossible to edit very large files, and disk partitions and such (unless you have a lot of RAM)

    greetings,
    frank

    Comment by frank — November 17, 2007 @ 2:54 pm |Reply

  2. @Frank:
    Yes and no. The currently only fully functional byte array model loads the source completely in memory. It is the quick’n’dirty variant. Another byte array model, which uses a paging mechanism (might later be changed to memory-mapping mechanism of the underlying OS), is currently only readonly. Plans are to make it readwrite, of course. But this is low priority at the moment, and might be outsourced to interested co-developers, once the Kakao framework is more stable. There is no undo/redo right now for example…

    Comment by frinring — November 17, 2007 @ 3:10 pm |Reply

  3. i agree with comment #1, large file editing is almost required to be useful IMO.

    Comment by definitly — November 17, 2007 @ 3:11 pm |Reply

  4. about your C++ question: if you want to achieve at compile-time something that can be achieved by using virtual functions, but you don’t want to use virtual functions, what you’re looking for is called the Curiously Recurring Template Pattern (search google/wikipedia).

    Comment by Benoit Jacob — November 17, 2007 @ 4:07 pm |Reply

  5. Congratulations on the new name, it’s simple, elegant and recognisable and the K in it doesn’t jump at you. I like it :).

    Comment by Robin — November 17, 2007 @ 4:10 pm |Reply

  6. Strange your blog title is “attracted by virtual constructs” and you don’t want to use it ;-)

    Comment by Gopala Krishna A — November 17, 2007 @ 4:11 pm |Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Toni Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: