[vwnc] How to arrange levels of code hierarchy ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] How to arrange levels of code hierarchy ...

marten
After now working in a larger project, we noticed, that we have problems
with the different levels of codes we have written - actually it is
written in C#, but it is a general problem and I would like to discuss
it here.

In general you have your domain classes defined within your language of
choice. Perhaps after some time you may have constraints between your
attributes (within this class - and changing one attribute at a  time
may result in errors) and then you are in the case, that you might want
to show users of your code, that there is a low level interface
definition for setting the base values of the attribute, but one should
always use the much higher interface levels considering all the
constraints problems.

The differentiations between public/private (in Smalltalk) might be
possible, but this is not a intuitive solution. Even categories are not
enough. What I find interesting that despite all the facilities C# has
(sealed, public, protected, private, ...) one can not express these
using guidelines.

Perhaps I might like to have a GUI (browser), showing me code at
different levels - and therefore leading the developers to use the right
methods.

Perhaps some you have ideas in this direction ?

Marten


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] How to arrange levels of code hierarchy ...

Antony Blakey-2

On 08/10/2008, at 5:35 PM, Marten Feldtmann wrote:

> Perhaps some you have ideas in this direction ?


 From an architectural perspective, shouldn't the concept of 'domain  
api' be reified more directly than by classifying methods? A domain  
api probably represents an discrete level of abstraction. Anyway, the  
following techniques come quickly to mind, although their  
appropriateness depends on other aspects of your architecture...

1. Put your public API in a trait (in my Stardust I visually annotate  
methods that come from a trait: http://linkuistics.com/ftp/Stardust-TraitAnnotation-2008-10-08.png)
; or
2. Put your public api in a superclass with the subclass being the  
concrete class that contains the implementation; or
3. Put your private api in an implementation delegate.

All are the same idea with different compositional paradigms.

Only the first has an appeal to me. In Stardust I am adding metadata  
to methods/classes/traits (to generalize pragmas), and one thing that  
falls out of this is multi-dimensional (orthogonal) classification,  
replacing e.g. method categories, with browser support.

In VW, you can use pragmas to get the same effect, and modify the  
browser to either filter or visually annotate methods with an  
appropriate visibility or domain specification pragma. It's not  
difficult to do that.

Antony Blakey
--------------------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Isn't it enough to see that a garden is beautiful without having to  
believe that there are fairies at the bottom of it too?
   -- Douglas Adams

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] How to arrange levels of code hierarchy ...

Rob Vens-2
In reply to this post by marten
In general finding that attributes within a class have interdependencies is a sign of a design problem. It is actually an anti-pattern.
The interdepending attributes are a candidate for reification: you should make them into a new class, with only an interface on the generic level, so that from the outside there is no direct access to those attributes themselves.
Of course this the general case, so I am curious if this strategy will be useful in your specific case.

2008/10/8 Marten Feldtmann <[hidden email]>
After now working in a larger project, we noticed, that we have problems
with the different levels of codes we have written - actually it is
written in C#, but it is a general problem and I would like to discuss
it here.

In general you have your domain classes defined within your language of
choice. Perhaps after some time you may have constraints between your
attributes (within this class - and changing one attribute at a  time
may result in errors) and then you are in the case, that you might want
to show users of your code, that there is a low level interface
definition for setting the base values of the attribute, but one should
always use the much higher interface levels considering all the
constraints problems.

The differentiations between public/private (in Smalltalk) might be
possible, but this is not a intuitive solution. Even categories are not
enough. What I find interesting that despite all the facilities C# has
(sealed, public, protected, private, ...) one can not express these
using guidelines.

Perhaps I might like to have a GUI (browser), showing me code at
different levels - and therefore leading the developers to use the right
methods.

Perhaps some you have ideas in this direction ?

Marten


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc