Questions tagged [package-design]

Use for questions about or related to the design of packages (groupings) of units of code (e.g. classes), as opposed to the design of the units of code themselves or design patterns.

Many programming languages have one or more ways of grouping code, for example Java's packages and jars. A concern in program design is how to choose the groups.

Robert C. Martin defined six principles of package design, which include

  • principles of package cohesion
    • REP - The Release Reuse Equivalency Principle
    • CCP - The Common Closure Principle
    • CRP - The Common Reuse Principle
  • principles of package coupling
    • ADP - The Acyclic Dependencies Principle
    • SDP - The Stable Dependencies Principle
    • SAP - The Stable Abstractions Principle

is a tool that evaluates Java programs against the above principles.

John Lakos's "Large Scale C++ Software Design" discusses how to manage dependencies in large C++ programs.

References

12 questions
60
votes
3 answers

Is package by feature approach good?

Recently I came across this javalobby post http://java.dzone.com/articles/how-changing-java-package on packaging java code by feature. I like the idea, but i have few questions on this approach. I asked my question but didn't get a satisfactory…
K. Siva Prasad Reddy
  • 11,786
  • 12
  • 68
  • 95
48
votes
9 answers

Your thoughts on "Large Scale C++ Software Design"

Reading the reviews at Amazon and ACCU suggests that John Lakos' book, Large-Scale C++ Software Design may be the Rosetta Stone for modularization. At the same time, the book seems to be really rare: not many have ever read it, and no pirate…
mlvljr
  • 4,066
  • 8
  • 44
  • 61
43
votes
13 answers

Circular dependencies

I have 2 projects. Project#2 has a reference to Project#1 Now I need to reference Project#2 in Project#1, but vs.net is complaining about a circular dependency. Is there a way out of this?
mrblah
  • 99,669
  • 140
  • 310
  • 420
20
votes
6 answers

Are there any rules for OOP?

Recently I heard that there are 9 rules for OOP(Java). I know only four as Abstraction, Polymorphism, Inheritance and Encapsulation. Are there any more rules for OOP?
Viki
  • 251
  • 1
  • 4
  • 7
8
votes
3 answers

Are there any significant disadvantages to depending upon abstractions?

After reading this wiki on the Stable Abstractions Principle (SAP) I was wondering if anyone knows any disadvantage to depending on abstractions rather than concretes (i suppose, that outweighs the advantages). The SAP states that the more stable a…
SteveCallender
  • 211
  • 1
  • 2
  • 9
7
votes
4 answers

How do you organise your code library?

I am interested to know how people organise their code libraries, particularly with respect to reusable components. I am talking in OO terms below but I am interested in how your organise libraries for other types of language also. For example: Are…
BlackWasp
  • 4,933
  • 2
  • 30
  • 42
5
votes
14 answers

Database Guy Asks: Object-Oriented Design Theory?

I've worked with designing databases for a loooong time, and these days I'm working in C# too. OO makes sense to me, but I don't feel that I have a good grounding in the deep theory of OO design. In database land, there's a lot of theory around how…
AJ.
  • 13,461
  • 19
  • 51
  • 63
2
votes
1 answer

Visualizing and keeping track of your package development state

What is a good way of keeping track of the state of development and/or visualizing how all your R packages are linked to each other (and its "third-party" dependencies)? I usually try to apply a "divide and conquer" strategy which by now - 5 years…
Rappster
  • 12,762
  • 7
  • 71
  • 120
2
votes
1 answer

Can we apply the REP, CRP, CCP, etc. principles to Java packages as well as to JARs?

Uncle Bob's Principles of OOD (http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod) describes: The five principles of class design The six principles of package design (The Release Reuse Equivalency Principle, The Common Closure Principle,…
aillusions
  • 194
  • 1
  • 15
2
votes
1 answer

Do I violates Common Closure Principle(CCP)

I have application with the following dlls: Web project - MVC web application Wcf Services - services that the web application uses. Model - Entity framework code first entities and DbContext object. Now when I need to change something lets say…
ilay zeidman
  • 2,654
  • 5
  • 23
  • 45
1
vote
3 answers

Architecture: principles for how to create multiple layers

As we know, nearly every complex architecture contains multiple layers. In a management system, we can easily come up with data access layer, business logic layer, and presentation layer without too much thinking. I want to know if there is a clear…
Dagang
  • 24,586
  • 26
  • 88
  • 133
1
vote
0 answers

Protect "Private" Objects in My R Package

Motivation I am developing an R package (call it pkg) which collects in a running cache some objects generated by its function calls. It is simple enough to implement the cache as a list object (call it .cache) in the pkg namespace. However, I want…
Greg
  • 3,054
  • 6
  • 27