Dia2Code transforms UML
class diagrams made with Dia into skeleton
source code. I wrote a plugin for it that will produce Objective-C code. Below you can
see a sample diagram and the code it yields, there still is a bit to do.
Diagram
#include "supertestclass.h"
@implementation superTestClass
- (int) zap: (NSString*)baz
{
};
+ (id) superTestClassFromString: (NSString*)aString
{
};
notMe
{
};
// Attribute accessors
@end;
// Private messages
@implementation superTestClass (Private)
@end
// Protected messages
@implementation superTestClass (Protected)
@end
#ifndef SUPERTESTCLASS_H
#define SUPERTESTCLASS_H
// powertype
@interface superTestClass
{
// Associations
// Attributes
@protected // public by accessor
float scoobyness;
float barness;
@private
NSString* doobyname;
static int numberOfObjects;
@protected
int foofooid;
}
// Operations
- (int) zap: (NSString*)baz;
+ (id) superTestClassFromString: (NSString*)aString;
notMe ;
// Attribute accessors
@end;
// Private messages, as a user of this class you should not use these!
@interface superTestClass (Private)
@end
// Protected messages, as a user of this class you should not use these!
@interface superTestClass (Protected)
@end
#endif
#include "testclass.h"
@implementation testClass
+ (void) glork: (int)dork
{
};
- (void) blinkWithColor: (int)color andFreq: (int)fre
{
};
// Attribute accessors
@end;
// Private messages
@implementation testClass (Private)
@end
// Protected messages
@implementation testClass (Protected)
@end
#ifndef TESTCLASS_H
#define TESTCLASS_H
#include "testinterface.h"
#include "supertestclass.h"
// utility
@interface testClass : superTestClass, testInterface
{
// Associations
// Attributes
@private
byte fooness;
}
// Operations
+ (void) glork: (int)dork;
- (void) blinkWithColor: (int)color andFreq: (int)fre;
// Attribute accessors
@end;
// Private messages, as a user of this class you should not use these!
@interface testClass (Private)
@end
// Protected messages, as a user of this class you should not use these!
@interface testClass (Protected)
@end
#endif
#include "testinterface.h"
@implementation testInterface
- (BOOL) testMe
{
};
// Attribute accessors
@end;
// Private messages
@implementation testInterface (Private)
@end
// Protected messages
@implementation testInterface (Protected)
@end
#include "testclass.h"
@implementation testClass
+ (void) glork: (int)dork
{
};
- (void) blinkWithColor: (int)color andFreq: (int)fre
{
};
// Attribute accessors
@end;
// Private messages
@implementation testClass (Private)
@end
// Protected messages
@implementation testClass (Protected)
@end
#ifndef TESTCLASS_H
#define TESTCLASS_H
#include "testinterface.h"
#include "supertestclass.h"
// utility
@interface testClass : superTestClass, testInterface
{
// Associations
// Attributes
@private
byte fooness;
}
// Operations
+ (void) glork: (int)dork;
- (void) blinkWithColor: (int)color andFreq: (int)fre;
// Attribute accessors
@end;
// Private messages, as a user of this class you should not use these!
@interface testClass (Private)
@end
// Protected messages, as a user of this class you should not use these!
@interface testClass (Protected)
@end
#endif
|