Re: Inner classes use

From: perry anderson (perry_at_cplusplus.org)
Date: 05/29/04


Date: Sat, 29 May 2004 12:17:47 -0300

inner classes where designed for a reason, simplicity of code is one. if
reducing class names in your global namespace is of importance to you go
right ahead. sounds to me like you are after reading up on some GoF...

give it a whirl, you'll know soon enough

- perry

devu wrote:
> Currently I'm working on a class that performs a batch process as per
> scheduling for all employees in a company. Being a batch process load
> is obviously a huge factor.
> The process first needs to calculate the eligibility of each employee
> before proceeding to the next stage. I need to cache some of the
> employee information if an employee is found eligible for later use in
> the next stage.
> One option could be a javabean style value object class with all
> required attributes and getter setter methods. However I would like to
> avoid the overhead of these method calls for say 3000 eligible
> employees. A lightweight object where I can access the attributes
> directly would help me
>
> I therefore propose an inner class....
>
> class Process {
>
> doEligibility () {
> EmpInfo a = new EmpInfo();
> a.attrib1 = //set it
> a.attrib2 = //set it
>
> //store in hashmap with empID as key
>
> }
>
> private Class EmpInfo { //INNER CLASS
> int attrib1;
> String attrib2;
> ....
> }
>
> doProcess {
>
> EmpInfo a = (EmpInfo) map.get("empID");
>
> //use the attributes directly
>
> }
> }
>
> Is this wrong/bad design ?? If so, what is a better way to achieve
> this ???



Relevant Pages

  • RE: Capturing an employee in a team at a point in time
    ... you will have a robust design that will not need altering. ... Access Query Grid interrogates the Windows setting and as ... you have entered a date in US m/d/y format. ... I would like to design a db that captures employee data. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Looking for PCB layout designer
    ... at a $5 adder to go to six layer), but that does *not* mean that they ... Descrimination against smart people (as well as ... for a digital design type job one question ... Are you saying that every employee should have identical skills? ...
    (sci.electronics.design)
  • Re: Still New to Access DB
    ... The tab order in the design view on the subform only is correct, ... Employee, can you add more than 1 record to it. ... EmpID ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Need a design suggestion
    ... You're right about getting to the data design early, ... Google the access newsgroups for "books" ... > * How do I make the form go to the latest pay period upon opening it? ... > employee, percent worked and OT. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Design Pattern Question
    ... but Proxy is pretty much designed for restricted or selective access. ... interfaces for Employee that only provide X, X+Y, or Z access. ... one "hard-wires" the appropriate interface for each client. ... I would like to explore this design further. ...
    (comp.object)