• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using java the C way?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!everyone
In my work ,I need to write a sms gateway interface platform,Then I search for similar project. I luckily find one,write in java,but they use java the C way,the code was written completely in C style.

As the communciate beteween involes some Commands,for example, BindCommand,SubmitCommand,DeliverCommand. I originally want to write a Command base class,make all the above Command inheirt from the base class.

but the reference project ,It is written alike
public class Main{
public void main(String args[]){
Main main = new Main();
main.bind();
main.submit();
}
} of course ,they write huge bind() submit() method,

I really hate this style,I try to design my system the OO way,but when I think it again,I thought the system is produre oriented in nature.the client systme make a connection to the server,send some command,then finish.
isn't it?

what should I Do?
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lolita

Well, if the system is big and complex in logic it would be difficult to migrate it to be more OO than procedural.

If you have resources then let the transition slow. Pick out pieces that if modified may not result into many compile/runtime errors (essentially the ones which may not break functionality in great manner ) and then slowly keep modifying and refactoring along the way....

I guess this is fairly logical known by any programmer but just my 2 cents.

Regards
Maulin
 
lolita ling
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maulin! thanks for your response.

The system is a small system,and the application logic is quiet strightward:
the client and the server established a connection,then send some command accrroding to the agreed procotol,and then tear the connection.

I think the system is produre oriented in nature,should I use the big class,i.e design the produral way?I am afraid tear this simple application into many classes maybe somewhat confuse the application logic
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lolita

maybe somewhat confuse the application logic

this is the precise thing you should try to avoid happening by making it better designed and coded

I would go with changing the implementation after having proper design and making sure that design wouldn't lose certain functionality that already exist and system would behave "same" (functionality wise) as it was in procedural version.

I assume you have CVS etc so you can revert back to procedural version if something goes wrong in the new implementation...otherwise first have CVS of the currently working sytsem and then proceed...

Thanks
Maulin
 
reply
    Bookmark Topic Watch Topic
  • New Topic