Update: Sanjay in Stirt felt his domain xp should be protective but no. GTD was key in that team.
DaShan: Prior Domain experience may not translate into higher code quality or productivity on the next job, due to restrictions and important differences between systems.
salary depends on many factors like
– budget and company size
– relationship with the site owner
– domain experience
When I first met DaShan, I felt he has some invisible upper hand as a developer with that domain experience. I felt that way because of the ignorance or “lack of domain knowledge”. Now I know that other people also see me with that Halo.
How about the high math of MSFM?
Consider choosing package names for your objects that reflect how your application is layered. For example, the domain objects in the sample application can be located in the
com.meagle.bo package. More specialized domain objects would be located in subpackages under the
com.meagle.bo package. The business logic begins in the
com.meagle.service package and DAO objects are located in the
com.meagle.service.dao.hibernate package. The presentation classes for forms and actions reside in
com.meagle.forms, respectively. Accurate package naming provides a clear separation for the functionality that your classes provide, allows for easier maintenance when troubleshooting, and provides consistency when adding new classes or packages to the application.
Look at Socket.java constructor signatures. As a client side internet socket (not UD-socket), the most basic address:port pair needed is the REMOTE address:port.
Q: so how about the local address:port?
A: Usually, only after a socket is created with the remote address:port, does the socket need to bind() to a local address:port.
Q: Can a Socket object can be on server side or client side.
A: I think both. See ServerSocket.accept() javadoc. accept() manufactures a socket object in the server jvm.
Q: Can a java Socket object be associated to 2 connections? The output data would broadcast into both channels?
By age 30, many peers have decided to focus on Cisco, on Oracle, on Microsoft dotnet, on IBM, on SAP, on Powerbuilder. Other choose to focus on a domain like online gaming, financials …
(By “focus”, i mean 50%-100% of their tech experience is related to the chosen field.)
I always feel what if one day you discover you don’t like your role in that particular ecosystem, or the vendor starts making questionable moves, or you don’t like the vendor’s tech support, or u notice their discrimination policy .. you would feel locked in, cos you have invested too much into it, putting all your eggs in a single basket.
In my case, i have several years experience in each of
– solaris, linux, hpux, freebsd
– Oracle, mysql
– java, C, perl, php
– weblogic, tomcat, sunone
Background: We see many method names that confuse some readers as to what objects would invoke them.
Q: which object will call “my” public methods?
A: Client objects. Public methods in myClass.java constitute the expected services presented to “consumers/customers”. Quintessential examples are accessors and constructors. Another instance of myClass often call them too, in some designs.
Q: who will call “my” private methods?
A: only the /hosting/ class or a nested class. This case is simpler than the “public” case.
I don’t agree that a package, a module and a class mean roughly the same. Yes 1-to-1 mapping among the trio. In perl, the package construct is all about namespaces, while modules are more complex.
Some say a package represents a namespace; others say a package is primarily a symbol table. In simplistic terms, a package is a common prefix (or tag) you attach to a bunch of identifiers like variables, subroutines… A module is vastly different. A module is often a library of subroutines. A module can also become a class if you add some features.
@myPackage::myArray_withoutAt is a typical usage of a package.
A Namespace consists of variables, subroutines …
In Python, i’d say such a “namespace” is a idic i.e. internal-dict
disk-block = disk-page
data-block = data-page
Data-blocks/pages are less physical and less low-level than disk-blocks/pages.
Standard disk-block/page sizes are 2, 4, 8, 16Kb. Larger blocks are used less often.
Reading a Disk Page should be one I/O.
A data-block can contian muliple disk-blocks. (http://gauss.ffii.org/PatentView/EP542483)
q: yield() vs sleep()
%%A: “sleep() won’t yield to other threads but will hog(??) the cpu.” I now think that was wrong. Any thread is subject to scheduling and queuing in the Eligible Club.
A: (forum) Both are Thread.java static members. Sleep will stop the current thread even if there are no others ready to run. Without guarantee (“heuristic”), JVM may stop the yeilding thread if there is another one that’s ready.
q: explain why recursive quicksort need log n additional space
q: pros and cons of vector vs arraylist, hashtable ^ hashmap
q: path to root
q: what objects will never be garbabe collected
q: baseclass of Exception?
q: name 2 subclasses of Throwable
A: Error and Exception. ( A prominent subclass of Exception is RuntimeException.)
q: can u add member variables to an interface
A: Yes. “member” can be static.
q: can you add constructors to an abstract class?
%% A *WRONG* : yes but they won’t run
A: yes they run upon subclass instantiation
q: when would u use a Runable?
1) the first “catch-phrase” to memorize is the most common
– – – > prepare/execute/fetch
All 3 methods are specified in DBI but implemented (vendor-specific) in DBD modules ie DBD drivers.
2) For non-select, prepare/execute will do.
3) The simplest: do() alone can replace prepare/execute.
5) stored procedure with 3 result sets ie 3 selects: prepare/execute /fetch/more_results/fetch/more_results/fetch
Beware that most of these methods belong to $statement_handle like
– – – – > $statement_handle -> method1
whereas a few belong to $db_handle.
 excluding select-into. I think a select-into always returns one(???) row and saves it into variables and does not produce a result set.
One of the wall street interviews asked “what are class objects” and I said objects are instances of a class, so class object is imprecise phrase.
Now I think “class object” refer that special object instantiated when a class is loaded by a java classloader. 2 classloaders can instantiate 2 such objects for the same myClass.java? Yes.
One possible reason for this iview question might be mem-leak. See posts on [[ root objects ]].
In LDAP, the situation is slightly more complicated. Names are built from components that are separated by commas (“,”). Like DNS names, they read from right to left. However, components in an LDAP name must be specified as name/value pairs. The name “cn=Todd Sundsted, o=ComFrame, c=US” names the person “cn=Todd Sundsted” in the organization “o=ComFrame, c=US.” Likewise, the name “o=ComFrame, c=US” names the organization “o=ComFrame” in the country “c=US.”
Conceptually, think of the GC daemon waking up and scanning all threads and all static fields.
1) call stacks  — Most obvious category of root objects are “objects of unfinished method CALLs”. For each unfinished CALL on each call stack, root objects include:
– every argument of reference type
– every local var (except primitives)
– that class object /hosting/ the static method
– that instance hosting the instance method
 I prefer “call stacks”. A “thread” is more than a call-stack — see blog post on call stack.
2) static fields — 2nd most obvious type of root objects are “static fields of loaded classes” . Technically, static fields are 2nd-level nodes whose parent nodes are “class-objects”. However, static fields are a more tangible thing to programmers.
 except primitive static fields (these aren’t objects per se, even if on heap)
 Every loaded class has a class-object which persists in memory forever => class loaders can introduce mem leaks. Not sure about class-unloading(???)
eg: most if not all constants defined as “public final static”
eg: D.seen in my debugger. On demand , D.java class  is loaded by JVM. During class loading, every single static vars must be initialized. D.seen is a HashMap, so the default initial value of D.seen is null, but in a subsequent method, we call new HashMap(). This HashMap becomes a root object.
 If you don’t use it, the D class is not loaded.
 (By the way, no D() constructor call needed.)
Q: Why is Math.PI always reachable after class loading?
A: Anyone can access PI any time.
Q: what if D.seen is not public?
A: D.d() is a public static method that relies on D.seen. Anyone can call D.d() any time. D.seen must remain in memory forever.
3) jni. It’s good to know how jni relates to other java technologies
other groups of root objects?
Now, some non-root objects that can linger forever:
- interned strings — see https://www.infoq.com/articles/Java-PERMGEN-Removed by a GC expert
- event listeners + observers. Persistent collections. We need to remember to unregister/unsubscribe listeners or observers. Swing is particular prone to memory leak.
- static collections such as a cache
Lesson 1: open / fetch..into / close
Lesson 2: open / fetch..into / %NOTFOUND / close
fetch cursor3 into record_var2;
exit when cursor3%NOTFOUND
-- do something with record_var2
declare/ %ROWTYPE / open / fetch..into/ %NOTFOUND / close
For a simple yet complete sample code, combine the last sample in this post and the previous post.
Lesson 1: open/fetch/close
Lesson 2: declare / open / fetch /close
declare the cursor
Lesson 3: open / fetch..into / close
fetch cursor3 into record_var2;
-- do something with record_var2
Lesson 4: declare / %ROWTYPE / open / fetch..into / close
After declaring the cursor, you declare a record-var to hold one row of data
CURSOR cursor3 IS SELECT ....
record_var2 cursor3%ROWTYPE ;
jargons: For each, interviewer can ask for examples(eg), suitable(j4)/unsuitable(n4) uses, or interviewer may mention them in a question, assuming your knowledge. Ranked roughly in order of likelihood
–“instead of” triggers
–FOR EACH ROW
eg: I actually created many for-each-row triggers in zed.
j4: perf? questionable — “If Oracle did attempt to buffer rows from a deterministic table function that returned many thousands of rows, it could result in performance issues due to excessive memory consumption. ” — http://www.dba-oracle.com/plsql/t_plsql_deterministic.htm
eg: (in function definition)
A regular stored program has a name — for invoke-by-name
j4: no need to invoke-by-name later. Just run once and throw-away
This is One reason I can understand.
The “context” /dictates/ which rules to apply.
The structure of the document is not understood or taken into account.
Both DOM and SAX know the context and structure.
From experts to novice, everyone uses the “layer” jargon in the context of testing, code reuse, modular design,
For starters, i have a blog post on “DB entity object HAS-A DAO”.
* import — Ideally, a upper-layer class imports lower-layer classes. Shared-layer classes can be imported by all.
* compile-time dependency — Ideally, low-layer classes should be compilable without upper-layer classes.
* reusable components — therefore, lower-layer classes should be reusable in other projects in the absence of upper-layer classes.
* testing — To test a upper-layer method (we didn’t say “class”), you often need to instantiate (or mock) the lower-layer objects. Even if you use interfaces, you still need to instantiate these lower objects to run their methods.
(Suggestion: reduce cross-layer inter-dependencies.)
* use-a, has-a — upper-layer classes could use-a or has-a lower-layer class, but not vice versa.
* separation of concern — lower-layer objects should not need to know about upper-layer. If my class uses xstream (or a mailer, a scheduler, a serializer, a parser, a timer…), then xstream should be oblivious of my class.
Both can operate on exactly one and only one list entry — the current entry.
I think an iterator shares other idiosyncrasies with a cursor.
A) you can create a table and revoke access of PUBLIC to it; then you can grant limited access privileges to the table through views. — http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.ddi.doc/ddi132.htm
B) Same for a stored procedure. You can remove read/write access to a table, but provide controlled read/write access to the table via stored procedures. Benefit? Better control. See post on [[ j4stored procedures — a sybase perspective ]]
A and B are related. Both can hide a group of “internal, raw tables” and present a “better” facade, better in some sense. Both use basic SQL and nothing else. Both provide access control. Difference? The 2 facades
– A View’s facade looks and feels like a table, to be used in FROM.
– A stored proc’s facade looks like …. an alien to SQL.
Andrew Yap asked “Why Hibernate?” My answers:
j4: hide details of database interactions
* increasing ROI as “domain models” complexity increases
* diminishing benefit for simple DB interactions.
j4: java programmers are comfortable with java objects than database entities. Without a persistence framework, “relationship mapping” is non-trvial.
* cost: hard to tune sql
J4: portability across databases
in context of collections
php-java integration nlg
debug xml parsing ] NBC
customizing complex php systems — moodle, mambo
many serious projects. 4? 5?
both on windows and *nix
OO: several projects
PEAR::DB and ADO (moodle)
Every function exists either (X) in an anon or (y) permanently in the databse.
This longevity view is a different view from anon-vs-named. “Named” is irrelevant in this view, since functions are always named.
Y) CREATE OR REPLACE FUNCTION my_func1 …
X) DECLARE FUNCTION my_func2 …
– as part of the declaration in an “anonymous-block”, X creates a short-lived, throw-away function, to be used in the enclosing anon only. A case of “nested block”. You will see 2 pairs of BEGIN/END.
– Y would save the function in the DB
See also [[ anon ^ named ]] for a wider discussion. This post focuses on how to create a function.
See also posts on
[[ facade: loose coupling && fewer dependencies ]]
synchronous ^ mq
mvc — loose coupling between M, V and C
web service client and server rely on RMI/RPC and are more coupled (than http client/server), but both agree on an xml format to reduce coupling.
— keywords (and synonyms)
easy edits — not possible in an entangled system. Edits to source code should not break other (battle tested, production quality) classes. [[ declarative control — enterprise design pattern ]]
“runtime change” — to object behaviour, without breaking other classes [[ runtime change to object behaviour ]], [[ create functionality without jvm restart]strategy ]]
“expected services” — [[ de-couple – using abstract^concrete class ]]
knowledge — “Object A must know everything about Object B” means tight-coupling. Loose-coupling means A only need to know the expected services of the interface B implements. The interface specifies/constitutes often a very loose contract between A and B. “So long as you support the expected service, i don’t care how you implement it internally.” Consider SSH client/server.
warning: “transparent” has 2 unrelated meanings in java.
[[better, lighter faster java]]
Key concept: coupling. The tighter, the less transparent
Key concept: put “peripherals SERVICES” out of the DOMAIN MODEL
– persistence service
– messaging service
– tx service
– sec service,
– serialization service
– printing service
– email service
For example, Tight coupling between a serialization service and the domain model means “the service is CUSTOMIZED for this biz”. Changes to domain
model requires changes to the service.
For example, Look at persistence. a transparent persistent SERVICE
persists any, yes any, object.
For example, look at serialization SERVICE, which serializes any, yes
Most imp technique –> reflection <–
Q: what u already understand (LJ) transparency@@
A: see-through. readable logic. an extra layer or functionality should not
impede overall AR readability
An informal list of attractive characteristics in developers. Rare and non-trivial qualities.
— top 10
* willing to take up unpopular or unattractive tasks like …
* documentation — willing, thorough
* unit test — habit of creating and maintaining his own unit tests
* miminize personal favoritism, esp. as a leader. Impossible to be 100%
* unbiased — against race/gender, languages, technologies
* willing to listen && think hard about opposing views when he need not
* communicate in the language of management and users. Many feel this is rare; many disagree.
* technical pdl && “vision” ie long term.
* “Composite capability” is dependant on many factors.
— not so rare
* cooperative — follow agreed but tedious team standards
* Think like the business owners. Many feel this is are; many disagree.
* patience — with novice colleagues
* accurate estimation. set realistic targets to help supervisor’s planning
* no entrenched positions on …
* willing to abandon his own design when appropriate
* publications and open source contributions
* thorough — attention to details …
* articulate — with technical discussions
* quick assessment, even though imperfect
* lifelong learning — fearless
* self-examination before checking others; lead by example. (Experienced developers have many dislikes.)
* ownership — of own code from beginning to end
* flesixible — with OT,
* troubleshooting — systematic, reasoning, Sherlock Holmes. Very few jobs need exceptional troubleshooting; usually a competent technie will do.
* fast learner — some jobs need unusually fast learners. Perhaps #2 asset. Another “Composite skill”
* proven leadership@@ I think you can be a pretty good leader if you score well on this list. U need not be a motivator. Fairness is much more important