For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2007 > Re: Of Java and C#









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Of Java and C#
andrewmcdonagh

2007-01-27, 9:55 pm



On Jan 28, 1:21 am, LX-i <lxi0...@netscape.net> wrote:
> Pete Dashwood wrote:
>
> is for people who come from a blank slate as far as software development
> goes, while the book I named is geared more towards folks who already
> know programming to some extent. (That's what he said in Appendix A.)
> It does seem to move at a pretty good clip, though - there have been
> sections I've had to go back and read again, the do the example program,
> then go back and read it yet again. However, that technique usually
> makes the point apparent. :)
>
> Here are the topics, by day, with the appendices...
> W 1 - The Java Language
> - Day 1 - Getting Started with Java
> - Day 2 - The ABCs of Programming
> - Day 3 - Working with Objects
> - Day 4 - Lists, Logic, and Loops
> - Day 5 - Creating Classes and Methods
> - Day 6 - Packages, Interfaces, and Other Class Features
> - Day 7 - Threads, Exceptions, and Assertions
> W 2 - The Java Class Library
> - Day 8 - Data Structures
> - Day 9 - Working with Swing
> - Day 10 - Building a Swing Interface
> - Day 11 - Arranging Components on a User Interface
> - Day 12 - Responding to User Input
> - Day 13 - Using Color, Fonts, and Graphics
> - Day 14 - Writing Java Applets and Java Web Start Applications
> W 3 - Java Programming
> - Day 15 - Working with Input and Output
> - Day 16 - Serializing and Examining Objects
> - Day 17 - Communicating Across the Internet
> - Day 18 - JavaSound
> - Day 19 - Creating and Using JavaBeans
> - Day 20 - Reading and Writing Data Using JDBC and XML
> - Day 21 - Writing Java Servlets and Java Server Pages
> Appendices
> A - Choosing Java
> B - Using the Java Development Kit
> C - Programming with the Java Development Kit
> D - Using the NetBeans Integrated Development Environment
> E - Writing Java 1.1 Applets
> F - Creating Web Services with XML-RPC
> G - Regular Expressions
> H - Where to Go From Here: Java Resources
> I - The Book's Website
>
> The latter ishttp://www.java21days.com- click on the "Fourth Edition"
> link. The example classes and Java source files are there, if you want
> to see the code he uses to teach these.
>
> (BTW, threads are really, REALLY !)
>
> home-brewed CM system, and am now the alternate programmer for it. The
> lead guy is working on a .NET conversion, partly to get around the
> limitations of the current ActiveX controls we currently use.
>
> When programmers check in a source code file, there are several checks
> we do to it, and cross-references that should be updated. The new .NET
> check-in page was deployed last month, and has been the most troublesome
> page in the system ever since. Within the system itself, there is the
> capability to create a control number against the system, and there have
> been a couple of formal bug reports.
>
> Monday this past w was day 3, "Working with Objects". This was also
> the day that I took it upon myself to begin writing the design for the
> changes we would do to fix these problems. It came to me - a lot of
> these processes need to do a line-by-line analysis of the code. Why not
> write one object to do it all?


>From an OO PoV ...that would be a major bad idea..


In OO we have a design principle called 'Single Responsibility
Principle'.

This is where every class has One and Only One responsibility.

A simple example of a Java Code Analyist....

In the case of code line by line code analysis, there are a number of
distinct Responsibilities:

1) Code File Parser - Whose Responsibility it is to Read the file
and decide which other classes should be used to handle the different
parts.

1...n) Code Analyser Classes - A different one Responsible for each
distinct Code target you want to analyse.

1...n) Analyst Reporter Classes - These would be Responsible for
sending the reports to stand out, email, log files, etc,


class JavaFileParser {
}


class JavaCommentAnalyst {
}

class JavaClassHeaderCommentAnalyst extends JavaCommentAnalyst {
}

class JavaMethodCommentsAnalyst extends JavaCommentsAnalyst {
}


interface CodeAnalystReporter{
void send(String report);
}

class EmailingCodeAnalystReporter implements CodeAnalystReporter {
}

class LoggingCodeAnalystReporter implements CodeAnalystReporter {
}

I suspect this example isn't what your class does, but we can go
through it when you post it....

HTH

Andrew

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com