Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.NET frameworks revisited
Message
From
06/04/2007 12:51:07
 
 
To
06/04/2007 12:40:38
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01208568
Message ID:
01213007
Views:
19
Once again your explanation is both concise and extremely useful ( I'm forwarding this to Randy Jean and a couple of other people who've been wrestling with this issue )

Hope you're still doing Strataframe stuff. i can see your presence on the forum there would be most useful.

I'll go for two rounds and throw in some crisps.

>>I am just wrapping my brain around partial classes, but between your explanations and what I am getting from the Strataframe docs and code I think I'm starting to get it.
>
>Partial classes are a kind of "trick" that MS pulls off with the compiler. Imagine that you have a massive class definition in a Fox .prg file. Some parts of the class deal with printing, some deal with compression, some deal with backups. If you have this single .prg in a source control system, when it is checked out, only one dev could work on this class in its single .prg file. In VFP, you cannot break the class definition out into separate .prg files. However, in .NET, you could could break the class out into the following source files:-
>
>
>
>CharlesHankey.cs
>CharlesHankey.Printing.cs
>CharlesHankey.Compression.cs
>CharlesHankey.Backups.cs
>
>
>
>Each file could containe something like the following definition:-
>
>
>
>// For some crazy reason, the CharlesHankey class derives (inherits) from the SF Business object.
>// Go figure? :)
>
>// In CharlesHankey.cs
>public partial class CharlesHankey : StrataFrameBusinessObject
>{
>   public CharlesHankey()
>   { }
>}
>
>// In CharlesHankey.Printing.cs
>public partial class CharlesHankey
>{
>   public void Print()
>   {...}
>}
>
>// In CharlesHankey.Compression.cs
>public partial class CharlesHankey
>{
>   public void Compress()
>   {...}
>}
>
>// In CharlesHankey.Backups.cs
>public partial class CharlesHankey
>{
>   public void Backup()
>   {...}
>}
>
>
>
>When the compiler does its stuff, it essentially sees that the partial class definitions that it finds in these code files all relate to the same class. So, it treats them all as a single class. Not only does this allow you to separate out all of the common functionality into single files, it has the added advantage of allowing multiple devs to work in different parts of the same class and additionally, you can easily extend the class's functionality whenever you want to by simply creating another partial class file.
>
>>I think I can get excited about this.
>
>Partial classes are really taken for granted and almost overlooked as a feature but you are right, they are brilliant and make things so much easier.
>
>>Ivan pointed to Stratatrain - training videos for Strataframe ( done in Amarillo so I assume they are affiliated though surprisingly I don't see them linked on the Strataframe site - maybe I just missed it ) Since I produced the 30 hours of training videos for VFE I am particularly interested in this. Have you seen them? Your reactions appreciated.
>
>I haven't actually seen them but I think they are part of a collaboration with one of the local colleges in Amarillo. From what I have heard, they are very good indeed but I have no experience of them myself.
>
>>Thanks again. Next time I'm in the ancestral homeland it's my shout.
>
>I'll hold you to that ;)


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform