Search the web
Sign In
New User? Sign Up
parlezuml · Parlez UML Study Groups
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
To Jason Gorman--Interface Seperation   Message List  
Reply | Forward Message #139 of 346 |
Re: [parlezuml] Re: To Jason Gorman--Interface Seperation

Hi!
 
I have not read the tutorial yet, but maybe it would make more sense if, instead of
 
((IXML)objCustomer.getXML());
you had read/written
 
((IXML)objCustomer).getXML();
(that is, cast to an IXML object before calling the getXML method)??
 
 
CU, Guillaume.
 
 
----- Original Message -----
Sent: Monday, November 06, 2006 10:22 AM
Subject: [parlezuml] Re: To Jason Gorman--Interface Seperation

--- In parlezuml@yahoogroups.com, "saintthomson" <saintthomson@...> wrote:
>
> Hi ,
> i have gone through the tutorial you have publiched ,
>
> I do have a doubt in the interface seperation tutorial, you have
> given an example
>
> in the customer class some clients need to know the id only and the
> others need to only convert the customer class into XML, so you have
> created two interface for IBusiness interface for ID and IXML for
> getting the XML
>
> So we have implemented the two in the customer class..
>
>
> Ok,
> I need to get the XML for the customer class
>
>
> i did this
>
> Customer objCustomer=new Customer();
>
> ((IXML)objCustomer.getXML());
>
> what difference it make when i have a method like getXML() in
> Customer Class
>
> and Call directly objCustomer.getXML();
>
>
> Do let me know iam using the correct call, or what advantage do we
> have in interface seperation
>
> Regards
>
> Thomson
>

Hi Thomson

That's a good question. Why would we bother to split Customer into two
interfaces if we only endf up binding to Customer, which implements
both of them?

But we don't have to explicity instantiate Customer in our client
code, like in your example above. An instance of Customer could be
passed in as a method parameter or passed in the constrcutor of your
client object. In which case, since we only want to use the getXml()
method, we can declare the parameter as being of type IXml.

I've posted a slightly fuller explanation here -
http://parlezuml.com/blog/?postid=286

Also, you might find the OO Design Principles tutorial very useful, as
it explores these things in more detail (and also covers design
quality metrics, which help to guide our understanding a little
better). You can find it on the OO Metrics page here:

http://parlezuml.com/metrics/index.htm

You should probably bear in mind that these OO desigtn metrics are
quite old now, and were never really that robustly designed. One of my
current activities is to revisit design quality and explore new models
that might help update our understanding, espeically in the light of
advances made in the last 10 years or so (e.g., automated
refactorings, TDD, continuous integration etc). Is something that was
difficult in 1995 still as difficult today?

Hope that helps

Kind regards

Jason Gorman
http://www.parlezuml.com



Mon Nov 6, 2006 11:08 am

gui_bertrand
Offline Offline
Send Email Send Email

Forward
Message #139 of 346 |
Expand Messages Author Sort by Date

Hi , i have gone through the tutorial you have publiched , I do have a doubt in the interface seperation tutorial, you have given an example in the customer...
saintthomson
Offline Send Email
Nov 6, 2006
7:22 am

... Hi Thomson That's a good question. Why would we bother to split Customer into two interfaces if we only endf up binding to Customer, which implements both...
jasongorman_uk
Offline Send Email
Nov 6, 2006
10:27 am

Hi! I have not read the tutorial yet, but maybe it would make more sense if, instead of ((IXML)objCustomer.getXML()); you had read/written ...
Guillaume Bertrand
gui_bertrand
Offline Send Email
Nov 6, 2006
11:22 am

Thanks Guillaume. for pointing out that , i missed the paranthesis ... sense if, instead of ... have ... the ... have ... for ... we ... into two ... ...
saintthomson
Offline Send Email
Nov 6, 2006
6:30 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help