How can I show some of the attributes of a UML Class Diagram?

N

noodle-head

I have a huge class with a lot of attributes and operations. I plan on using
multiple drawings to illustrate different parts of each class, but I do not
know how to show some, but not all, of the attributes ( and operations).
 
J

John Saunders

noodle-head said:
I have a huge class with a lot of attributes and operations. I plan on
using
multiple drawings to illustrate different parts of each class, but I do
not
know how to show some, but not all, of the attributes ( and operations).

I don't know how to do this either (I think the answer is - SOL). But maybe
this is a hint that the class is too large? The same way they used to tell
us that if you lost your way thumbing through page after page of a program
listing, then maybe your function was too large and should be kept to a
single page?

John Saunders
 
N

noodle-head

In certain circumstances I would agree that the class should be refactored.
However, there are times even in a small class were the addition of a few
extra attributes or operations on a drawing confuse more than clarify the
intent of the design. This just happens to be one of those cases.
 
J

John Saunders

noodle-head said:
In certain circumstances I would agree that the class should be
refactored.
However, there are times even in a small class were the addition of a few
extra attributes or operations on a drawing confuse more than clarify the
intent of the design. This just happens to be one of those cases.

I agree. I've been wishing for "transparent delegation" in C# recently. I'd
like to be able to delegate the implementation of an interface to a
contained object which implements it - but without manually writing the
delegations:

public interface IFacet1
{
void DoFacet1();
}

public interface IFacet2
{
void DoFacet2();
}

public class LargerClass : IFacet1, IFacet2
{

private class CFacet1 : IFacet1
{
private void DoFacet1(){};
}

private class CFacet2 : IFacet2
{
private void DoFacet2(){};
}

private CFacet1 _cFacet1 implements IFacet1;
private CFacet2 _cFacet2 implements IFacet2;

public LargetClass()
{
_cFacet1 = new CFacet1();
_cFacet2 = new CFacet2();
}
}

No need to implement

private void DoFacet1()
{
_cFacet1.DoFacet1();
}

in LargerClass.

Oh, well, dreaming.

John Saunders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top