View previous topic :: View next topic |
Author |
Message |
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Sun Jan 30, 2005 12:45 pm Post subject: |
|
|
I do agree. The primary reasons why I even dreamt up the idea of translating the OGRE library were A) its an OO 3d lib for gosh sakes! and B) it seems very solidly designed. So naturally I don't want to deviate much from the original OGRE team's design. However... Sinbad already deviates, which is partly why I think starting over might be a good idea.
I also agree on "filtering" the event system through D. You're experiments using paired interfaces and mixins sounds like it was gaining successes, so that's probably the way to go. If nothing else, using interfaces may make Sinbad a little more extendable than the original OGRE, or at least more easily so. (I'm a dreamer.) _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 30, 2005 2:06 pm Post subject: |
|
|
csauls wrote: | I do agree. The primary reasons why I even dreamt up the idea of translating the OGRE library were A) its an OO 3d lib for gosh sakes! and B) it seems very solidly designed. So naturally I don't want to deviate much from the original OGRE team's design. However... Sinbad already deviates, which is partly why I think starting over might be a good idea. |
I don't think there is enough to say that it deviates What I've actually done is to start with the exampleapplication, copying the code from OGRE, translating it to D and adding the API to Sinbad as needed. What this means is that we need *exactly* the same API as in OGRE and probably makes it a silly way to do it. When coding up something, whether there is a design at the bottom or not, I like starting with a fairly simple demo to make something work, then flesh it out. Anyway, I find it difficult to both use a existing design (OGRE) and make it 'better', because changes to one part most likely will have a deep impact on the rest. I would love to start over and I once did (2 years ago, just after I discovered D), but I lost everything in a diskcrash. I lost faith and forgot many of my ideas, which were really good .
casuls wrote: |
I also agree on "filtering" the event system through D. You're experiments using paired interfaces and mixins sounds like it was gaining successes, so that's probably the way to go. If nothing else, using interfaces may make Sinbad a little more extendable than the original OGRE, or at least more easily so. (I'm a dreamer.) |
Well, I think it will work, but it will make the API more or less the same as the one in OGRE. To get it properly D-ified, I think we need use-cases describing all aspects, then designing it from the bottom, using one or more of delegates, interfaces, templates/mixins, etc.
I think I need a couple of days to contemplate Sinbad's future (for my part of it), unless you have some revolutionary new insights Your thoughts/doubts(?) have given me something to think about. |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Sun Jan 30, 2005 10:10 pm Post subject: |
|
|
Revolutionary new insights I have not, despite consulting a six pack of Killian's and my favorite pipe. So do your contemplation/experimenting and see how you feel, and we'll go from there. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Mon Apr 04, 2005 3:23 pm Post subject: |
|
|
After a couple of days (or was it months?) of contemplating, I'm inclined to continiue on the path we've started. I'm not experienced enough with the actual design of a 3D library to start all over. You're in? |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Tue Apr 19, 2005 10:58 am Post subject: |
|
|
I know this is such an ancient topic... but I'm thinking that if we come across any Singletons that don't need inheritance capabilities, we should use the abstract-static style as mentioned on the newsgroups. I might do a little experimenting though, to see if abstract-static can be used with inheritance, which is doubtful, but interesting to note if possible. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Apr 19, 2005 12:27 pm Post subject: |
|
|
I don't think I've read that thread in the NG. Could you enlighten me? |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Tue Apr 19, 2005 9:14 pm Post subject: |
|
|
Okie... basically a singleton written using abstract-static looks like this:
Code: |
public abstract class MySingleton {
// SINGLETON
static:
// ... everything else ...
}
|
This essentially just creates something like a namespace. If inheritance does somehow work with this (highly doubted) it would make for an interesting paradigm. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
BabaLi
Joined: 15 Jun 2007 Posts: 5 Location: France, Paris
|
Posted: Tue Jul 24, 2007 5:53 pm Post subject: |
|
|
In dazel we have this singleton:
Code: | module dazel.templates.singleton;
template Singleton()
{
static private typeof(this) instance_ = null;
static public typeof(this) getInstance()
{
if (typeof(this).instance_ is null)
typeof(this).instance_ = new typeof(this)();
return instance_;
}
}
|
You just need to mix it. _________________ Alexandre Bique
Epita promotion 2009 |
|
Back to top |
|
|
|